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
399for the Earth,3for the center of gravity of the Earth-Moon system, or0for the very center of the Solar System itself, though it might also be a specific object like aGeographicPositionon the Earth’s surface or anEarthSatellitein 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 vectorsvf1andvf2. This will raise an error unless thetargetwhere one of the two vectors ends is the same as thecenterfrom which the other vector starts.
- vf1 - vf2
Return a new vector function whose
at(t), when called, computes where thetargetofvf1will be positioned relative to thetargetof 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
tis 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 thecenterattribute:Solar System Barycenter:
BarycentricCenter of the Earth:
GeocentricAnything else:
ICRF