I have not taken a math class outside statistics since about 2001… I know that for some people this will be easy but for me it lives just outside my ability.
I am working on a program to control some lights for my aquarium. I would like to simulate a sunrise and sunset with the brightness of my light. The only thing I have left so far is the brightness of my light.
To keep it simple I want to design math algorithm as follows.
- In my head I see a sine wave but I am only worried about positive numbers.
- I would like values from 0-1. 0 is sunrise and sunset, 1 is full brightness. The y-axis is going to represent the intensity of the sun.
- The length of the day is going to me variable could be represented in minutes/seconds etc. Time is going to be graphed on x-axis
So… In a nut shell this is my question: Given the time of sunrise and sunset I can derive length of the day. I would like to know how I could get the intensity of any given point between sunrise and sunset. I want to write my function so that the variables are sunrise, sunset, and current time and be able to determine intensity. What is the math going to look like on this?
If you need more clarification let me know.
EDIT
As I play with a graphing calculator I am starting to like what I see BUT… I still can't nail it down…
y=-1/2 cos(x)+.5 gives a nice curve. But… Now how do I translate that to time. I want the first time the line hits y=0 to represent sunrise then the first time the line hits y=1 to represent solar noon and the second time y=0 to represent sunset.