Skip to content

Latest commit

 

History

History
19 lines (11 loc) · 1.03 KB

solar-system-body-state.md

File metadata and controls

19 lines (11 loc) · 1.03 KB

//astronomy/io.github.cosinekitty.astronomy/GravitySimulator/solarSystemBodyState

solarSystemBodyState

fun solarSystemBodyState(body: Body): StateVector

Get the position and velocity of a Solar System body included in the simulation.

In order to simulate the movement of small bodies through the Solar System, the simulator needs to calculate the state vectors for the Sun and planets.

If an application wants to know the positions of one or more of the planets in addition to the small bodies, this function provides a way to obtain their state vectors. This is provided for the sake of efficiency, to avoid redundant calculations.

The state vector is returned relative to the position and velocity of the originBody parameter that was passed to this object's constructor.

Parameters

body The Sun, Mercury, Venus, Earth, Mars, Jupiter, Saturn, Uranus, or Neptune.