-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(math): radians and degrees functions
- Loading branch information
Showing
2 changed files
with
11 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
const DEG_TO_RAD = Math.PI / 180; | ||
const RAD_TO_DEG = 180 / Math.PI; | ||
|
||
export function radians(degree) { | ||
return degree * DEG_TO_RAD; | ||
} | ||
|
||
export function degrees(radian) { | ||
return radian * RAD_TO_DEG; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters