typpo / spacekit

Javascript library for 3D space visualizations
https://typpo.github.io/spacekit/
MIT License
527 stars 39 forks source link

Add probe object with mass, velocity and direction vector? #67

Open rev111 opened 2 years ago

rev111 commented 2 years ago

Hello, I was wondering if it would be possible to add an object (for example, a probe) to the system that has a velocity and direction and is bound to gravitational influences? For example: Insert a probe in an earth object, accelerate towards the moon, slingshot around the moon and return back to earth?

If there are no space physics currently available in the simulation, would it be possible to attach my own calculations how that object should move and update the simulation accordingly?

Thanks for any help on this matter!

typpo commented 2 years ago

Hi @rev111, the engine currently handles Kepler orbits and Ephemeris tables. In other words, you'd have to attach your own calculations that describe the probe's movement. Here's some example code which produces this visualization.

Here is the documentation for EphemerisTable. In summary, you'd provide date + position and velocity vectors.

Hope this helps!