How to use this app?
Under the headline Where are you? enter your location. You can do this by either using GPS, entering your coordinates if you know them, or entering your address.
You can also drag the marker to where you are, and click on ENTER COORDINATES.
In the next section you will see how far you travelled due to earths rotation / around the sun / with the sun through the galaxy since you clicked the button.
You will also see your travelling velocity.
Why we need your location
To calculate the velocity of of the earths rotation, we need to know your latitude.
Assuming you are standing at the equator, then you will travel about 40000km (earths equator circumference) in one day.
But if you are standing at one of the poles (earths rotation axis). You will only spin around once in a whole day.
So you see, the rotation speed is the biggest at the equator, and gets smaller the further you travel north or south.
As you click on the button, the program remembers the time. From there on the program calls a function every 10 milliseconds.
This function takes the time between now and the starting time, and multiplies it by the velocity.
The velocities for the sun through the galaxy, and the earth around the sun are simply facts we got from the internet. The exact pages are documented under resources.
The velocity of the earths rotation is a bit more complex. As stated above, it depends on the latitude you are standing on.
We know, that the earth rotates once in a day. So all we need is the circumference of your latitude.
For the circumference we need the radius.
For that we use this formula:
latitudeRadius = cos(latitude) * r
With r being equal to the earths radius, and theta to the latitude
Now that we have the radius at our latitude, we can calculate the circumference of it with following formula:
circumference = 2 * PI * latitudeRadius
All we have to do now, is to divide the circumference by 24h, and we get our rotation speed in distance per hour.