dh4gan / nbody-js

Vanilla Javascript code that simulates N Body systems
0 stars 0 forks source link

Orbit draw is very slow #4

Closed dh4gan closed 5 years ago

dh4gan commented 5 years ago

Orbit draws are currently done by multiple calculation calls for a range of orbital longitudes.

This could be improved by a single draw call of an ellipse or parabola/hyperbola.

dh4gan commented 5 years ago

Ellipses and circles are easy enough. Drawing parabolae/hyperbolae are possible using Bezier curves, and this could be more involved. A compromise solution would be to draw ellipses and circles for e<1, and to plot points for e>=1

dh4gan commented 5 years ago

Ellipses and circles now drawn by a single call. Unbound orbits still use a multiple point draw