At 08:29 PM 2/27/2011, you wrote: >Hi all, > >I'm working on a solar tracker and would like to calculate the >sunrise/sunset position. The aim is to use a PIC controlling a >pair of steppers and gear trains > >One algorithm frequently cited is this one > >http://williams.best.vwh.net/sunrise_sunset_algorithm.htm > >That page is reproduced below > >Now, the first problem has arisen. Do I assume correctly that the >C function "floor" is similar to INT ? ie, the decimal part of a result >is discarded ? > >http://en.wikipedia.org/wiki/Floor_and_ceiling_functions > >15th November 2010, day of year (by addition) 319 > >31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 15 =3D 319 > >day =3D 15, month =3D 11, year =3D 10 ^^^^^^^ Here's the problem, you're in the wrong millennium! year !=3D 10 ; year =3D= 2010 Now it will work out to 319. (N3 =3D 2) Best regards, Spehro Pefhany --"it's the network..." "The Journey is the rewar= d" speff@interlog.com Info for manufacturers: http://www.trexon.co= m Embedded software/hardware/analog Info for designers: http://www.speff.co= m --=20 http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .