blob: 69c3a60e9babb811c7afda54a6b4e5f18f75ce3e [file] [log] [blame]
Kevin Lubickd1c6cc12021-01-21 11:41:01 -05001/**
2 * This file houses miscellaneous helper functions and constants.
3 */
4
5var nullptr = 0; // emscripten doesn't like to take null as uintptr_t
6
7
8function radiansToDegrees(rad) {
9 return (rad / Math.PI) * 180;
10}
11
12function degreesToRadians(deg) {
13 return (deg / 180) * Math.PI;
14}
15
Kevin Lubickd1c6cc12021-01-21 11:41:01 -050016function almostEqual(floata, floatb) {
17 return Math.abs(floata - floatb) < 0.00001;
18}