# Sun/stars orbit and climate

I understand this is a broad topic that to a degree was answered in previous questions.

What I'm trying to do is to create a plugin in Unreal 4. I'll start by creating a day/night system and a skysphere as realistic as possible and then move on to climate, biomes etc.

While to some degree I understand about how to create a sun sky orbit based on geo coordinates that has the right elevation for the sun and the day length, what I don't know is how the rising and setting horizon spot works. I know that it's exactly on east/west on equinoxes and the furthest away on solstices, what I don't know are two things. How the distance between equinox and solstice horizon spots are calculated and what happens in between?

Is it a standard number? And how do I find that? Once I find that is it a simple lerp between the two spots? Or on some days it changes less than on others?

For the star chart should it simply follow the sun movement?

After that I'll move to climate zones... Anything else that has to do with the sun or the moon that I should keep in a table or a variable to be reused that affects the climate zones besides the axial tilt, the rotation period around the sun and the distance from the sun?

While the system will be used for the earth mostly I'd like to have open sliders so I could use it for another planet in the future with different distance from the sun different axial tilt different type of star etc.

Thanks for the help and your time!

I believe the short answer is that "it depends entirely on your coordinate system".

https://en.wikipedia.org/wiki/Position_of_the_Sun

It gets much easier if you're using a spherical system to begin with, but I imagine if it's on the computer, you're already in a x-y-z system, so you'd need to do a bit of conversions.

As for the star grid, it's important to remember the stars are effectively staying in the same place on the sphere around the earth, but the earth is the one moving. As such, in any given "night", the stars will move in a steady 'circle' depending on the latitude (equator would have stars move across almost the entire sky, while at the poles everything more spins around the north/south star) - day to day this would change, but over the entire night it wouldn't need to be constantly recalculated.

Once again, there's a lot of different coordinate systems you can use: https://en.wikipedia.org/wiki/Celestial_coordinate_system

Re: climate, this has one very simple thing: The climate zones are entirely defined by the tilt of the planet. Our earth's tilt is 23.5 degrees, so going 23.5 degrees from the poles or the equator defines the climate zones. This is because this defines the areas in which you'll have well defined seasons. Check out "Geographical_zone" on wikipedia, which I would link, but it isn't letting me.

• Thanks for that. Yes I know about coordinates system. The problem is that I can't have a rotating terrain without completely messing up physics or forking the engine. That said, what I plan is to have a stationary terrain with a spherical sky map on which stars are textured and sun/moon are moving on. I understand that in day to day simulation stars won't change but in a year round simulation their orbit will, I just don't know how. I have a feeling it's pretty similar to the sun's change which would make this much easier, but honestly I don't know. Mar 16, 2017 at 18:40
• Well, the stationary terrain is an easy hurdle, due to relativity. If one is stationary, the other is moving in relation. So a stationary ground reference point would see the celestial sphere move, although the celestial sphere isn't moving. You just have it moving in the opposite direction. The answer to how the stars are moving over the year is exactly answered by calculating parallax: en.wikipedia.org/wiki/Parallax But I should note the earth's tilt is much more a cause of stars changing where they are - 23.5 degrees is very significant. Mar 16, 2017 at 18:52

The chances are that your players simply won't notice the change in horizon entry/exit points let alone the accuracy of the placement.

If you want seasonal changes in day/night periods, then I'd just change the day/night lengths accordingly and lower the arc of the sun if you feel that's realistic.

The climate of course depends on what's normal for the geographic area that you're simulating (temperate, desert, equatorial, etc.).

• I'm not doing it for a game or players... I'm just trying to create a simulation (for myself... AFAIK noone would be interested in it for the reasons you explained). Mar 16, 2017 at 14:19
• Apologies, I assumed you were using Unreal as a game engine.
– user10945
Mar 16, 2017 at 14:24