From 4b070493e60bc50319f6b943da5f46686e14f846 Mon Sep 17 00:00:00 2001 From: Sublunar Space Date: Tue, 18 Dec 2018 12:49:12 +0100 Subject: [PATCH] fixed negative sidereal degrees for Pisces --- js/SL.Astro.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/js/SL.Astro.js b/js/SL.Astro.js index b35639b..bc864fc 100644 --- a/js/SL.Astro.js +++ b/js/SL.Astro.js @@ -122,7 +122,8 @@ SL.Astro = (function() { if ( sidereal == 1 ) { deg -= 24.11722222222; // degrees difference between tropical and sidereal } - if ( deg >= 360.0 ) deg = Math.abs(deg - 360.0); + if ( deg >= 360.0 ) deg -= 360.0; + if ( deg < 0 ) deg += 360.0; var zod = getZodiac(deg, 0); var diff = ( zod.sign - 1 ) * 30.0; var degrees = deg - diff; @@ -142,7 +143,8 @@ SL.Astro = (function() { if ( sidereal == 1 ) { deg -= 24.11722222222; // degrees difference between tropical and sidereal } - if ( deg >= 360.0 ) deg = Math.abs(deg - 360.0); + if ( deg >= 360.0 ) deg -= 360.0; + if ( deg < 0 ) deg += 360.0; deg += 0.0001; // added to compensate rounding, resulting in 0° to 29.99° being Aries instead of 0° to 30° var obj = { sign: Math.ceil(deg / 30),