CarloZambaldo/OrbitalMechanics — reverse-engineered prompt

Reverse engineered prompt

Build me a MATLAB orbital mechanics toolkit that feels simple to use for homework and quick mission analysis. I want an ORBIT object that I can create either from the usual orbital elements or from position and velocity, and it should automatically fill in the useful derived values like period, energy, periapsis, apoapsis, orbit type, and the current state vectors. I also want easy helpers to convert back and forth between cartesian and keplerian form.

Please make it easy to propagate an orbit over time, plot it in 3D, animate it, and generate ground tracks around a rotating planet. If possible, include support for both a basic two body model and an option for perturbed motion. I would also like small utilities like time of flight between anomalies, checking whether a point lies on the orbit, and escape velocity.

Also add an ASTRO object for celestial bodies by name, with things like gravitational parameter, radius, and a simple way to draw the body. Please keep it working cleanly in MATLAB with clear examples and comments, and look up any current MATLAB details if you need to.

Want more depth? Deep Reverse