# Sine Graphs and Orbital Paths

## Recommended Posts

So as I was rewatching the 0.23.5 release trailer, I noticed the orbital path on the big screen in the control room. But then I thought that the path looked an awful lot like a graph of the sine or cosine functions. Compare this:

To this:

So, the question is: what equation defines the graph of the projection of inclined orbits onto a map? I think inclination affects amplitude, but I can't really figure anything else besides that. Shifting shouldn't be a factor because the orbit shifts itself, but what function defines the shift that occurs with each orbit relative to orbital period and inclination? How would one figure this out?

##### Share on other sites

The orbit shift is because of the rotation of the earth under it... and is specifically a function of the orbital height. If you picked the right height (say 50000 km) the wave wouldn't shift over like that.

##### Share on other sites

Not sure about a function, but the shifting of the orbit is just the planet's rate of rotation relative to the speed of the orbiting object.

##### Share on other sites

It depends a lot on the projection, but the picture you show is based on equirectangular projection, which makes the most sense for this sort of application.

For an equirectangular projection, call the horizontal position (longitude) Ãâ€  and vertical position (latitude) ÃŽÂ¸. (So we are looking to plot function ÃŽÂ¸(Ãâ€ ).) For a circular orbit with inclination ÃŽÂ±, where ÃŽÂ± = 0 corresponds to equatorial orbit, the latitude is given by the function:

ÃŽÂ¸(Ãâ€ ) = sin-1(sin(Ãâ€  - Ãâ€ 0) sin(ÃŽÂ±) / Sqrt(sinÃ‚Â²(Ãâ€  - Ãâ€ 0) + cosÃ‚Â²(Ãâ€  - Ãâ€ 0) cosÃ‚Â²(ÃŽÂ±)) )

Where Ãâ€ 0 is the latitude of the ascending node. For non-circular orbits, the formula will be quite a bit more complex.

Edit: There, that should work. Though, it does not account for planet's rotation. If you want to throw that in, you'll need to figure out orbital period and adjust Ãâ€  accordingly.

Edited by K^2
##### Share on other sites

• 3 weeks later...

K^2, is there a way to graph the lat/lon traversed over time? I'm having massive problems making an orbit like this in a 3D application/XYZ space using pure trig and I think spherical coordinates may be my way out. As longitudes are traversed more quickly at different latitudes, I have no idea where to start or even where to look for such a specific solution.

Anyway, here's the above equation made interactive on Desmos Graphing Calculator if anyone wants to play with it: https://www.desmos.com/calculator/ui8awrisw5

(for those wondering why it looks like a square wave, this is a near polar orbit (87Ã‚Â° inclination), which, just like the poles of Earth in an equirectangular projection map, stretch out. A 90Ã‚Â° inclination will return an actual square wave, and an equatorial orbit will be a flat line, and a 51Ã‚Â° inclination like the ISS will return a nice soft sine-wave looking curve.

As for the math to make it mesh with the rotation of the Earth, divide a 24-hour day by the orbital period (let's use 90 minutes) (24x60)/90 = 16 360/16= a loss of 22.5Ã‚Â° per orbit, so you'll want to sample the image once every 360-22.5=337.5Ã‚Â° and stack the samples on top of each other to see your forthcoming orbits.

##### Share on other sites

Start with a circular orbit of radius r around the equator. At t = 0, T, 2T, ..., kT, you are back at (x,y,z) coordinate (r,0,0):

x = r cos(Ãâ€°t)

y = r sin(Ãâ€°t)

z = 0

Ãâ€° = 2Ãâ‚¬/T = sqrt(ÃŽÂ¼/r3)

Now rotate this orbit by the inclination angle ÃŽÂ± about the x axis:

x -> x

y -> y cos(ÃŽÂ±) - z sin(ÃŽÂ±)

z -> y sin(ÃŽÂ±) + z cos(ÃŽÂ±)

x = r cos(Ãâ€°t)

y = r sin(Ãâ€°t) cos(ÃŽÂ±)

z = r sin(Ãâ€°t) sin(ÃŽÂ±)

Now the orbit is correctly inclined, but the longitude of the ascending node is zero. So rotate the entire orbit about the z axis by Ãâ€ 0, the new longitude of the ascending node:

x -> x cos(Ãâ€ 0) - y sin(Ãâ€ 0)

y -> x sin(Ãâ€ 0) + y cos(Ãâ€ 0)

z -> z

Thus

x = r cos(Ãâ€°t) cos(Ãâ€ 0) - r sin(Ãâ€°t) cos(ÃŽÂ±) sin(Ãâ€ 0)

y = r cos(Ãâ€°t) sin(Ãâ€ 0) + r sin(Ãâ€°t) cos(ÃŽÂ±) cos(Ãâ€ 0)

z = r sin(Ãâ€°t) sin(ÃŽÂ±)

ÃŽÂ¸(t) = asin(z/r) = asin(sin(Ãâ€°t) sin(ÃŽÂ±))

Ãâ€ (t) = atan(y/x) = atan((cos(Ãâ€°t) sin(Ãâ€ 0) + sin(Ãâ€°t) cos(ÃŽÂ±) cos(Ãâ€ 0)) / (cos(Ãâ€°t) cos(Ãâ€ 0) + sin(Ãâ€°t) cos(ÃŽÂ±) sin(Ãâ€ 0)))

But note that you should use a 2-argument inverse tangent function atan2(y,x), because atan2(-y,x) is different from atan2(y,-x), which atan(y/x) can't tell.

And as mentioned above, if you want the coordinates relative to the surface of the body you are orbiting, subtract the rotation of the body: Ãâ€ (t) -> Ãâ€ (t) - Ãâ€°bt.

Edited by Yasmy
##### Share on other sites

I managed to figure this out by generating the orbit which was simple to incline around one axis (I had already gotten that far by the time of my post), then transposing the XYZ to spherical coordinates, where it was simple to offset the longitude of the path being generated, and then converting back to XYZ.

Your solution is definitely more elegant though and I'd assume less prone to accrue error over time than my back-and-forth so I will definitely incorporate it into version 2.

Thanks a lot!

##### Share on other sites

• 2 years later...

Hello everybody, I may have missed something, but what I assume are greek characters in this thread are displayed to me as a mangle of characters (for example "Ãâ€" for what appears to be Lambda and "ÃŽÂ" for what seems to be Phi. Is there a way to display those characters appropriately?

Anyway, I didn't wait for a solution and tried to implement Yasmy's formulas in one of my projects by identifying the characters and decyphering the formulas. It mostly works, I have all the orbital paths I want, except when my ascending node is set too close to Pi/4 mod(Pi/2) (ie 45°, 135°, etc) where I get non-sensical orbits. I tried to debug the formulas but the display errors makes it very difficult.

Below is an example of the problem I am running into; there are three curves, one of which is pretty and has ascending node at 0°, and the ugly ones are close to 45° and -45°.

##### Share on other sites

All those posts are from before the forums changed, so they're pretty much broken for all eternity now

##### Share on other sites

Nooo

Well, I will try to solve it myself. I'll post the corrected formulas here if I succeed.

Thank you anyway!

Edit: Turns out I made a mistake when I entered the formulas to generate my points.

Here are Yasmy's equations in a readable form.

Circular equatorial orbit of radius r with angular speed omega, inclination phi0 and longitude of ascending node lambda0:

x(t) = r*cos(omega*t)

y(t) = r*sin(omega*t)

z(t) = 0

Note that omega = 2*Pi/T = sqrt(G*M/a3) with T the orbital period, G the gravitational constant, M the mass of the body and a the radius of the circular orbit.

Rotation around the x axis to change inclination to phi0 by the transformation:

x -> x

y -> y*cos(phi0) - z*sin(phi0)

z -> y*sin(phi0) + z*cos(phi0)

This gives us:

x(t) = r*cos(omega*t)

y(t) = r*sin(omega*t)*cos(phi0)

z(t) = r*sin(omega*t)*sin(phi0)

Rotation around the z axis to change longitude of ascending node to lambda0 by the transformation:

x -> x*cos(lambda0) - y*sin(lambda0)

y -> x*sin(lambda0) + y*cos(lambda0)

z -> z

That gives us:

x(t) = r*cos(omega*t)*cos(lambda0) - r*sin(omega*t)*cos(phi0)*sin(lambda0)

y(t) = r*cos(omega*t)*sin(lambda0) + r*sin(omega*t)*cos(phi0)*cos(lambda0)

z(t) = r*sin(omega*t)*sin(phi0)

We finally have:

phi(t) = sin-1(z(t)/r) = sin-1(sin(omega*t)*sin(phi0))

lambda(t) = tan-1(y(t)/x(t)) = tan-1((cos(omega*t)*sin(lambda0) + sin(omega*t)*cos(phi0)*cos(lambda0)) / (cos(omega*t)*cos(lambda0) - sin(omega*t)*cos(phi0)*sin(lambda0)))

And remember to use atan2(y,x) when possible to dissipate any sign ambiguity.

To have the coordinates of the orbiting object on the surface of the body, apply the transformation:

lambda(t) -> lambda(t) - omegab*t (With omegab the angular speed of the body's surface.)

Edited by Darkvidor
solved the problem, adding the solution to the post

## Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

×   Pasted as rich text.   Paste as plain text instead

Only 75 emoji are allowed.

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×

• #### Community

• Release Notes

• #### Social Media

• Store
×
• Create New...