⨠Tests for point class
This commit is contained in:
parent
11785baf1f
commit
57059dbbd2
9 changed files with 534 additions and 43 deletions
15
lib/utils.ts
Normal file
15
lib/utils.ts
Normal file
|
@ -0,0 +1,15 @@
|
|||
/** Rounds a value to PRECISION */
|
||||
export function round(value: number): number {
|
||||
return Math.round(value * 1e2) / 1e2;
|
||||
}
|
||||
|
||||
/** Radians to degrees */
|
||||
export function rad2deg(radians: number): number {
|
||||
return radians * 57.29577951308232;
|
||||
}
|
||||
|
||||
/** Degrees to radians */
|
||||
export function deg2rad(degrees: number): number {
|
||||
return degrees / 57.29577951308232;
|
||||
}
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue