Skip to content

Commit

Permalink
feat(math): radians and degrees functions
Browse files Browse the repository at this point in the history
  • Loading branch information
MrTelanie committed Apr 27, 2021
1 parent 5b15362 commit 96741bf
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/angles.js
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;
}
1 change: 1 addition & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export {
Color, IColor, color, icolor
} from './color';
export { IMat3 } from './mat3';
export { radians, degrees } from './angles';

export function calc(alg) {
return operatorCalc(alg);
Expand Down

0 comments on commit 96741bf

Please sign in to comment.