0

i was having a tough time deciding on which SE site to post this rather unique question being that it would help me with a program I'm writing. I decided to come to you guys, not hoping that you would come up with the equation for me, but rather tell me if its even possible to begin with.

My program is a day/night cycle which works fine in itself but i was hoping to add some sort of equation that could compute the time of day based off a few dynamic variables.

Variables: starting rotation position, rotation speed, distance between hour A and hour B(15 degrees between each hour making 360 degrees after a full day)

All of these variables have values set in my program, i was hoping somebody could tell me with those variables would it be possible to calculate the starting time based off where a user places the sun with these factors? I have a working game clock already i just wanted it to be more user friendly with a working equation! If i posted this on the wrong site or its just completely irrelevant, i apologize in advance. If anybody can weigh in on this it would be more than greatly appreciated!!

Thanks, Dave

davedno
  • 101
  • 1
    Can you please give some context? What is rotating? The Earth? – Alex R. Jun 14 '15 at 23:37
  • my apologies, its a sphere that holds a sun object, so as the sphere rotates the sun will also rotate with it, the user can rotate the sphere any which way along the x axis. this rotates around a stationary terrain. – davedno Jun 14 '15 at 23:41
  • So, you're looking for a linear equation? As I don't know what exactly you mean with "rotation speed" and "starting rotation position", I cannot write down the answer, but it seems to be very simple. – Stefan Mesken Jun 15 '15 at 00:25
  • Rotation speed is a set value at which represents how fast the sun is rotating, and the starting position is where the sun first starts off at when the program is ran. Say if a person sets the sun in the program to be completely vertical from the camera or 90 degrees from the origin I would want the equation to spit out 12:00 noon time. So if somebody wanted to move the sun to a different spot in the sphere it would calculate the time without the user needing to input any values, I'm sorry if I'm not being clear – davedno Jun 15 '15 at 00:38

0 Answers0