API Reference — Vector Functions¶
The Skyfield API is build atop vector functions that take time as input and produce a position vector. You can create vector functions for the Earth, Moon, Sun, planets, and Earth satellites, and can combine them using addition and subtraction.
- class skyfield.vectorlib.VectorFunction¶
Given a time, computes a corresponding position.
- center¶
The Solar System object from which this vector is measured. Often this is an integer code like
399
for the Earth,3
for the center of gravity of the Earth-Moon system, or0
for the very center of the Solar System itself, though it might also be a specific object like aGeographicPosition
on the Earth’s surface or anEarthSatellite
in orbit around it.
- target¶
Using the same set of possible values as the
center
, this attribute names the target to which the vector is pointing. The vector, then, is the three-dimensional difference between the position of the center and that of the target.
- vf1 + vf2
Return a new vector function whose
at(t)
, when called, computes the sum of the original vectorsvf1
andvf2
. This will raise an error unless thetarget
where one of the two vectors ends is the same as thecenter
from which the other vector starts.
- vf1 - vf2
Return a new vector function whose
at(t)
, when called, computes where thetarget
ofvf1
will be positioned relative to thetarget
of the subtractedvf2
. Note that this will be an instantaneous vector, uncorrected for the amount of time light takes to travel from one target to the other. This raises an error unless the two vectors share the samecenter
.
- at(t)¶
At time
t
, compute the target’s position relative to the center.If
t
is an array of times, then the returned position object will specify as many positions as there were times. The kind of position returned depends on the value of thecenter
attribute:Solar System Barycenter:
Barycentric
Center of the Earth:
Geocentric
Difference:
Geometric
Anything else:
ICRF