mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
Fix arc negative radians issue
This commit is contained in:
parent
fb113e2054
commit
b2fcf787e2
2 changed files with 20 additions and 13 deletions
|
@ -60,8 +60,14 @@ export const normalizeRadians = (angle: Radians): Radians => {
|
|||
export const cartesian2Polar = <P extends GenericPoint>([
|
||||
x,
|
||||
y,
|
||||
]: P): PolarCoords =>
|
||||
polar(Math.hypot(x, y), normalizeRadians(radians(Math.atan2(y, x))));
|
||||
]: P): PolarCoords => {
|
||||
const [radius, angle] = polar(
|
||||
Math.hypot(x, y),
|
||||
normalizeRadians(radians(Math.atan2(y, x))),
|
||||
);
|
||||
|
||||
return [radius, normalizeRadians(angle)] as PolarCoords;
|
||||
};
|
||||
|
||||
/**
|
||||
* Convert an angle in degrees into randians
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue