Skip to content

Commit

Permalink
Add comment regarding cartesianToPolar radian shift
Browse files Browse the repository at this point in the history
  • Loading branch information
techniq committed Feb 21, 2025
1 parent a6c1c4a commit 03496e3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/layerchart/src/lib/utils/math.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export function polarToCartesian(angle: number, radius: number) {
export function cartesianToPolar(x: number, y: number) {
let radians = Math.atan2(y, x);

radians += Math.PI / 2;
radians += Math.PI / 2; // shift 90 degrees to align 0deg at 12 o'clock

// Ensure the result is between 0 and 2π
if (radians < 0) {
Expand Down

0 comments on commit 03496e3

Please sign in to comment.