Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions reference-implementation/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,43 @@
});
};

defineMath("SQRT2P1", Math.SQRT2 + 1);
defineMath("SQRT3", Math.sqrt(3));
defineMath("SQRT5", Math.sqrt(5));
defineMath("SQRT3_2", Math.SQRT3 / 4);
defineMath("SQRT2_3", 4 / Math.SQRT3);
defineMath("PHI", (Math.SQRT5 + 1) / 2);
defineMath("DEG_PER_RAD", Math.PI / 180);
defineMath("RAD_PER_DEG", 180 / Math.PI);
defineMath("TAU", 2 * Math.PI);
defineMath("CLOCK1", Math.PI / 6);
defineMath("CLOCK2", Math.PI / 3);
defineMath("CLOCK3", Math.PI / 2);
defineMath("CLOCK4", Math.CLOCK2 * 2);
defineMath("CLOCK5", Math.CLOCK1 * 5);
defineMath("CLOCK6", Math.PI);
defineMath("CLOCK7", Math.CLOCK1 * 7);
defineMath("CLOCK8", Math.CLOCK2 * 4);
defineMath("CLOCK9", Math.CLOCK3 * 3);
defineMath("CLOCK10", Math.CLOCK2 * 5);
defineMath("CLOCK11", Math.CLOCK1 * 11);
defineMath("CLOCK12", Math.TAU);
defineMath("NORTH", Math.TAU);
defineMath("NNE", Math.PI / 8);
defineMath("NE", Math.PI / 4);
defineMath("ENE", Math.NNE * 3);
defineMath("EAST", Math.PI / 2);
defineMath("ESE", Math.NNE * 5);
defineMath("SE", Math.NE * 3);
defineMath("SSE", Math.NNE * 7);
defineMath("SOUTH", Math.PI);
defineMath("SSW", Math.NNE * 9);
defineMath("SW", Math.NE * 5);
defineMath("WSW", Math.NNE * 11);
defineMath("WEST", Math.EAST * 3);
defineMath("WNW", Math.NNE * 13);
defineMath("NW", Math.NE * 7);
defineMath("NNW", Math.NNE * 15);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it will be very hard to make the case for lines 26-53. If you can remove those, I will merge this.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I plan to add this proposal to the agenda for the next meeting.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was this ever put on a meeting agenda?


const f32A = new Float32Array(1);

Expand Down