webdial

Incomplete JS port of moondial.
git clone https://code.literati.org/webdial.git
Log | Files | Refs

commit c3ccbadccb68e3fdd3a2cc61ff47acfa8f1148ab
parent 3f947b7593566b2f74d7f42cdc42f6633e25b16a
Author: Sean Lynch <seanl@literati.org>
Date:   Thu,  8 Sep 2011 08:51:07 -0700

Try to avoid splitting night shape

Diffstat:
Msun.js | 6++++--
1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/sun.js b/sun.js @@ -86,9 +86,11 @@ function Sun() { equ = this.ecl_to_equ(H, alt, obl); x = Math.round(equ.ra * w / PI2 + x_offset) % w; y = Math.round((0.5 - equ.dec / Math.PI) * h); + if (px !== undefined && (Math.abs(x-px) > w / 2 + || Math.abs(y-py) > y / 2)) break; points.push([x,y]); - prev_x = x; - prev_y = y; + px = x; + py = y; } return points };