Skip to content

Latest commit

 

History

History
20 lines (12 loc) · 990 Bytes

helio-distance.md

File metadata and controls

20 lines (12 loc) · 990 Bytes

//astronomy/io.github.cosinekitty.astronomy/helioDistance

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.

Return

The heliocentric distance in AU.

Parameters

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.