SP4CEBAR 2023-10-25 18:56 (Edited)
I'm working on some orbit simulators again, and I went to Desmos to graph my problem.
All you need to construct a graph of an orbit is an apoapsis (longest distance to one of the ellipse's focal points), a periapsis (shortest distance to one of the ellipse's focal points) value, and some geometrical ratios within ellipses
Here's a demo:
on this elliptical function, I've implemented the rotation matrix on the general conic section formula that I found a while back, I forgot how I found it but it works nonetheless, maybe I found it on the internet, or I somehow found out how to calculate it.
I've written some notes a while ago where I found how I could construct hyperboles from an apoapsis and an asymptote
McPepic 2023-10-26 01:37
When describing orbits, I like to think of them in terms of the semi-major axis and the eccentricity. How difficult would it be to get these variables to work with the algorithm?
nathanielbabiak 2023-10-26 01:39
Very cool! I'd be happy to help if you need any asistance with the orbital mechanics if this turns into a game of sorts.
SP4CEBAR 2023-10-26 05:14 (Edited)
Thanks! I think an eccentricity and semi-major axis could be determined from the apoapsis and periapsis points (and the gravitational body on one of the ellipse's focal points). This ellipse is fully defined, so all the information should be there.
The only part that isn't defined by this ellipse is the orbital velocity, I will need to make a discrete implementation of it if I want to add a time-warping feature.
I've resumed an old project of mine where I've already made planets and a method to plot the graph of a conic section (orbit path). It uses a recursive motion physics simulator, which isn't that accurate for orbits, but it'll do for now. I've added apoapsis (minimum velocity) and periapsis (maximum velocity) detection which works but it takes an orbital period to figure out. Next, I'll implement the graph from the demo.