Files
astronomy/source/kotlin/doc/-observer/to-vector.md
Don Cross 53f5540f09 Kotlin: cleanup of code and documentation.
Used IntelliJ IDEA's linter to perform code cleanup.
There were unused variables, `var` that could be replaced with `val`,
and other minor code style issues.

While doing this, I also discovered that a lot of documentation
links were broken. The fix is to stop intenting the text after
a `@param`.
2022-04-27 14:04:42 -04:00

1.9 KiB

//astronomy/io.github.cosinekitty.astronomy/Observer/toVector

toVector

fun toVector(time: Time, equator: EquatorEpoch): Vector

Calculates geocentric equatorial coordinates of an observer on the surface of the Earth.

This function calculates a vector from the center of the Earth to a point on or near the surface of the Earth, expressed in equatorial coordinates. It takes into account the rotation of the Earth at the given time, along with the given latitude, longitude, and elevation of the observer.

The caller may pass a value in equator to select either EquatorEpoch.J2000 for using J2000 coordinates, or EquatorEpoch.OfDate for using coordinates relative to the Earth's equator at the specified time.

The returned vector has components expressed in astronomical units (AU). To convert to kilometers, multiply the vector values by the scalar value KM_PER_AU.

The inverse of this function is also available: Vector.toObserver.

Return

A vector from the center of the Earth to this geographic location.

Parameters

time The date and time for which to calculate the observer's position vector.
equator Selects the date of the Earth's equator in which to express the equatorial coordinates. The caller may select EquatorEpoch.J2000 to use the orientation of the Earth's equator at noon UTC on January 1, 2000, in which case this function corrects for precession and nutation of the Earth as it was at the moment specified by the time parameter. Or the caller may select EquatorEpoch.OfDate to use the Earth's equator at time as the orientation.