Quote:
I am not quite understand how I would sin the time of day.
Sure, sin of any number between 0-90 will be between 0....1 and 90-180 will be 1...0 which is perfect, but what unit to I relay this to when using time of day.
oh, remember sin() and cos() take radians as input, not degrees. So, it would be the hours value between dawn = 0, then dusk = pi = 3.14159..., and dawn again at 2pi = 6.28318... Or, if you wanted time to progress faster, you could make an entire day pass each hour. Then, at x:00 would be dawn, x:15 could be high noon, x:30 could be dusk or twilight, x:45 could be midnight, then (x+1):00 would again be dawn.
You could really scale these however you want, to acheive the values for x and timeAtDawn. Just remember that the period of sine is 2pi and scale that to whatever period in hours/minutes that you want.
Greenspun's Tenth Rule of Programming: "Any sufficiently complicated C or Fortran program contains an ad-hoc, informally-specified bug-ridden slow implementation of half of Common Lisp."