A simulation of orbital trajectories using the d3-force simulation engine with the gravity-like d3-force-magnetic attraction force.
By default the layout represents a binary system. All the stars (red nodes) have the same mass and their attraction influence on the satellite (blue node) is proportional to the inverse-square of the distance. The stars are statically positioned and remain unaffected by either the satellite or other stars. Stars can be added and removed by double-clicking on canvas/nodes. All nodes can also be repositioned by dragging.
The initial velocity (and direction) of the satellite can be changed using the controls on the top-right. The length of the pre-estimated trajectory can be manipulated by changing the number of samples (represented as dots).
See also Single Orbital Trajectory.
xxxxxxxxxx
<head>
<script src="//cdnjs.cloudflare.com/ajax/libs/d3/4.11.0/d3.min.js"></script>
<script src="//unpkg.com/d3-force-magnetic"></script>
<script src="//unpkg.com/kapsule"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/dat-gui/0.6.5/dat.gui.min.js"></script>
<script src="orbital-canvas.js"></script>
<link rel="stylesheet" href="orbital-canvas.css">
<style>body { margin: 0; }</style>
</head>
<body>
<div id="orbital-canvas"></div>
<script src="index.js"></script>
</body>
https://cdnjs.cloudflare.com/ajax/libs/d3/4.11.0/d3.min.js
https://unpkg.com/d3-force-magnetic
https://unpkg.com/kapsule
https://cdnjs.cloudflare.com/ajax/libs/dat-gui/0.6.5/dat.gui.min.js