http://williams.best.vwh.net/sunrise_sunset_algorithm.htm

which gives step by step English explanation of what it is doing.

It uses sin, cos, tan, asin, acos & atan functions.

I have generated all the tables with a program and saved them as c arrays

in an effort to implement the needed trig function using lookup tables since

the platform I'm using doesn't have a maths lib.

Just to clarify...

sin, cos & atan should range from 0-360,

asin, acos & tan from 0 to 1.

Is that right?