Skip to content

Commit

Permalink
fix(degree): correct deg to rad handling
Browse files Browse the repository at this point in the history
  • Loading branch information
MrTelanie committed Sep 26, 2019
1 parent 7beb643 commit ea726bc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/degree.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
// @ts-nocheck
import { normRad } from './util';

const ANGLE = Symbol('angle-rad');
const DEG_TO_RAD = Math.PI / 180;
const RAD_TO_DEG = 180 / Math.PI;
Expand Down Expand Up @@ -45,7 +47,7 @@ export class Degree extends ADegree {
if (angle instanceof ADegree) {
this[ANGLE] = angle[ANGLE];
} else {
this[ANGLE] = degToRad(angle);
this[ANGLE] = normRad(angle * DEG_TO_RAD);
}
}
}
Expand Down

0 comments on commit ea726bc

Please sign in to comment.