From 3944202a833a4021e402324b209cf735d35c9072 Mon Sep 17 00:00:00 2001 From: Casper Lamboo Date: Mon, 28 May 2018 13:53:32 +0200 Subject: [PATCH] add tau constant --- src/sliceActions/helpers/comb.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/sliceActions/helpers/comb.js b/src/sliceActions/helpers/comb.js index d39d190..2f6ed67 100644 --- a/src/sliceActions/helpers/comb.js +++ b/src/sliceActions/helpers/comb.js @@ -131,9 +131,10 @@ function lineSegmentsCross(a, b, c, d) { return (r > 0.0 && r < 1.0) && (s >= 0.0 && s <= 1.0); } +const TAU = Math.PI * 2.0; function normalizeAngle(a) { - a %= Math.PI * 2; - return a > 0.0 ? a : a + Math.PI * 2; + a %= TAU; + return a > 0.0 ? a : a + TAU; } function betweenAngles(n, a, b) {