Skip to content

Commit 939bdad

Browse files
committed
use mod to compute angle delta
- thanks @alexcjohnson for the tip!
1 parent 8575b27 commit 939bdad

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/lib/angles.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,7 @@ function isFullCircle(aBnds) {
3737
* @return {number} angular delta in *radians*
3838
*/
3939
function angleDelta(a, b) {
40-
var d = b - a;
41-
return Math.atan2(Math.sin(d), Math.cos(d));
40+
return mod((b - a) - PI, twoPI) - PI;
4241
}
4342

4443
/**

0 commit comments

Comments
 (0)