# How Does Earth Move In Relation To The Stars

In my simulation, I have stars scattered around Earth, all stars are the same distance from the center of the Earth and positioned based on their right ascension and declination like so:

I am wondering how the movement of Earth can be simulated based on the current time when running the simulation.

I am using the hyg v3 database which can be found here. I think that this dataset has the data necessary to find out the motion of stars, but I may be wrong.

Also, due to the structure of this simulation, with almost 120,000 stars, it is much more efficient to rotate/move the Earth rather than move all of the stars.

How can I show the stars visible over a location at a certain time by simulating the motion of the stars by rotating Earth?

• This is really nice! Is the source code public? In comparison to the celestial sphere, the Earth rotates around the north pole; the direction would depend on how you've drawn the stars, but is traditionally counterclockwise as viewed from the north pole.
– user21
Feb 26, 2020 at 19:54
• The math is publicly known and as source available in programmes like stellarium Feb 26, 2020 at 21:13
• @barrycarter - Hi! The source code will be available once I finish the project, I will pm you to inform once it’s public. Thanks!
– SidS
Feb 26, 2020 at 22:23
• Hi @planetmaker, it would be great if you could link me to the math, I am quite new to astronomy so I am struggling a little :)
– SidS
Feb 26, 2020 at 22:28
• I recommend Jean meeus -'Astronomical algorithms' amazon.com/Astronomical-Algorithms-Jean-Meeus/dp/0943396611 I used that with a few friends to write a program displaying the local sky several years ago Feb 27, 2020 at 4:58

The orientation of Earth wrt the stars repeats each sidereal day (thus ~23:56h). The visible night sky only changes each (synodic 24h) day due to the different direction the sun is at when considering the star's rest frame.

If you have the star's position from like now, you simply rotate Earth for each our by 360/(23.933)° = 15.04°. If you want to do that for an arbitrary date, take the stars' position: they come with a datum like J2000 which means their position on January 1st 2000 UTC. C calculate the sidereal days passed since then, accounting for the incomplete rotation of the current day which gives the rotation around the Earth's axis as above.

If you want to go into more detail and longer time, and account for centuries and longer, you will need to take into account the nutation and presession of the Earth axis.

• Does this mean that the Earth rotates by 360 degrees every 23h and 56 mins?
– SidS
Feb 26, 2020 at 22:22
• Yes. Sidereal day is defined as same orientation with respect to stars Feb 27, 2020 at 4:45
• Perfect, thank you very much! Also, how did you calculate the angle 23.933°?
– SidS
Feb 27, 2020 at 15:53

If north is up, right ascension should increase left to right on the near side of the celestial sphere. The near side of the Earth should rotate left to right with a period of 23h56m04s. The prime meridian on Earth should align with RA 0h at 12:07 UT on March 20 and 3m56s earlier per day after that.

The constellations may be more recognizable if you differentiate the stars by apparent magnitude and show only those brighter than magnitude 6 or so. The scale is logarithmic: magnitude 1 is 2.51 times as bright as magnitude 2, etc. A smaller factor, e.g. 1.6 per magnitude, may result in a nicer appearance.

• So the Earth rotates clockwise by 360 degrees every 23h, 56mins and 4sec? Also thanks for the magnitude tip, I will take in account the logarithmic scale
– SidS
Feb 26, 2020 at 22:25
• Clockwise as viewed from the south celestial pole, counterclockwise as viewed from the north celestial pole. 360 deg in 23:56:04. Feb 26, 2020 at 22:50
• Thanks! Also, do I need to take into account the Earth's tilt?
– SidS
Feb 27, 2020 at 15:50
• The Earth's north pole should align with the north celestial pole. The tilt is relative to the plane of its solar orbit. Feb 27, 2020 at 15:56
• Ok, so I don't need to take into account the tilt of the Earth?
– SidS
Feb 27, 2020 at 15:58