sunwait icon indicating copy to clipboard operation
sunwait copied to clipboard

Negative longitude reported as E instead of W.

Open Jerry2840 opened this issue 5 years ago • 2 comments

sunriset.c Has: /* Note: Eastern longitude positive, Western longitude negative */

I changed sunwait.h to my location: //#define DEFAULT_LATITUDE 52.952308 //#define DEFAULT_LONGITUDE 359.048052 /* The Buttercross, Bingham, England / #define DEFAULT_LATITUDE 40.767218 #define DEFAULT_LONGITUDE -111.902899 / Salt Lake City, Utah */

It looks like the times are right, but is says E instead of W. I am not sure what is setting the E or W in the code.

# ./sunwait report

  Current Date and Time: 15-Jun-2019 21:23 MDT

Target Information ...

               Location:  40.767218N, -111.902899E
                   Date: 15-Jun-2019
               Timezone: MDT

Sun directly north/south: 13:27 Twilight angle: -0.83 degrees (daylight) Day with twilight: 05:54 to 21:01 It is: Night

Jerry2840 avatar Jun 16 '19 03:06 Jerry2840

Note: the 'N' and 'E' are hard coded in print.cpp (bug). I deleted those letters in mine, before compilation, without effecting additional functionality.

eucratic avatar Jun 18 '19 09:06 eucratic

Interestingly The Butter Cross Public House is at 52.9526528,-0.9538435 (from Google Maps) which the default has as 360-0.9538435=‭359.0461565‬ so it's using positive values for West by going full circle.

So your longitude of -111.902899 would be ‭248.097101‬ (which is a bit quirky) but avoids using negative numbers.

DougieLawson avatar Sep 07 '19 14:09 DougieLawson