//astronomy/io.github.cosinekitty.astronomy/helioDistance
fun helioDistance(body: Body, time: Time): Double
Calculates the distance between a body and the Sun at a given time.
Given a date and time, this function calculates the distance between the center of body and the center of the Sun, expressed in AU. For the planets Mercury through Neptune, this function is significantly more efficient than calling helioVector followed by taking the length of the resulting vector.
The heliocentric distance in AU.
body | A body for which to calculate a heliocentric distance: the Sun, Moon, EMB, SSB, any of the planets, or a user-defined star. |
time | The date and time for which to calculate the distance. |