Sunset, sunrise, twilight calculations in LC?

Kay C Lan lan.kc.macmail at gmail.com
Sat Aug 23 04:28:47 EDT 2014


Nope, but this will help you calculate the Julian Date Number, which
you'll need:

   put the date into tDate
   convert tDate from date to dateItems
   if  ((item 2 of tDate = 1) or (item 2 of tDate = 2)) then
      put 1 into tDay
   else
      put 0 into tDay
   end if
   put item 1 of tDate + 4800 - tDay into tYear
   put item 2 of tDate + (12 * tDay) - 3 into tMonth
   put item 3 of tDate + \
         ((153 * tMonth + 2) div 5) + \
         (365 * tYear) + \
         (tYear div 4) - \
         (tYear div 100) + \
         (tYear div 400) - \
         32045 into tJDN

On Sat, Aug 23, 2014 at 7:46 AM, Charles E Buchwald <charles at buchwald.ca> wrote:
> Hi List People,
> Does anyone know of an LC version of sunrise/sunset and twilight calculations?
> I found a couple of web based APIs, but I'd like it to work offline.
> I found this: http://en.wikipedia.org/wiki/Sunrise_equation ... but it's going to take me a while to translate that into LC, which is why I'm asking.
> - Charles
>
> --
> Charles E. Buchwald
> CEO/Director General
> Museografica Digital
> http://digital.museografica.com
>
> Mac OSX 10.9.4, LC 6.6.2 Commercial
>
> LC Developer Tools: http://buchwald.ca/developer-tools/
>
> Email Notice: http://wp.me/P3aT4d-33
>
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode




More information about the use-livecode mailing list