Skip to content

Latest commit

 

History

History
26 lines (15 loc) · 1.88 KB

correct-light-travel.md

File metadata and controls

26 lines (15 loc) · 1.88 KB

//astronomy/io.github.cosinekitty.astronomy/correctLightTravel

correctLightTravel

fun correctLightTravel(func: PositionFunction, time: Time): Vector

Solve for light travel time of a vector function.

When observing a distant object, for example Jupiter as seen from Earth, the amount of time it takes for light to travel from the object to the observer can significantly affect the object's apparent position. This function is a generic solver that figures out how long in the past light must have left the observed object to reach the observer at the specified observation time. It uses PositionFunction to express an arbitrary position vector as a function of time.

This function repeatedly calls func.Position, passing a series of time estimates in the past. Then func.Position must return a relative state vector between the observer and the target. correctLightTravel keeps calling func.Position with more and more refined estimates of the time light must have left the target to arrive at the observer.

For common use cases, it is simpler to use backdatePosition for calculating the light travel time correction of one body observing another body.

For geocentric calculations, #geoVector also backdates the returned position vector for light travel time, only it returns the observation time in the returned vector's t field rather than the backdated time.

Return

The position vector at the solved backdated time. The t field holds the time that light left the observed body to arrive at the observer at the observation time.

Parameters

func An arbitrary position vector as a function of time.
time The observation time for which to solve for light travel delay.