Skip to content

Commit

Permalink
update x coordinate to include pi readings
Browse files Browse the repository at this point in the history
  • Loading branch information
anakaren-rojas committed Jan 14, 2025
1 parent 0ceef0e commit fcf3324
Showing 1 changed file with 14 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,21 @@ function SinusoidGraph(props: SinusoidGraphProps) {
index: number,
coordinate: vec.Vector2,
): string {
const x = coordinate[0];
const y = coordinate[1];

const convertedXCoordinate =
x === 0
? `0`
: x % 2 === 0
? `${x / 2} pi`
: x % 1 === 0
? `${x}/2 pi`
: `${x * 2}/4 pi`;

const coordsObj = {
x: srFormatNumber(coordinate[0], locale),
y: srFormatNumber(coordinate[1], locale),
x: convertedXCoordinate,
y: srFormatNumber(y, locale),
};

return index === 1
Expand Down

0 comments on commit fcf3324

Please sign in to comment.