skyfielders / python-skyfield

Elegant astronomy for Python
MIT License
1.39k stars 209 forks source link

Vector addition and subtraction #751

Closed delcompan closed 2 years ago

delcompan commented 2 years ago

eph = load('de/de421.bsp') sun, earth = eph['sun'], eph['earth'] A: print((sun - earth).at(t)) # retrun B: print((earth - sun).at(t)) # retrun C: print(earth.at(t)) # retrun D: print(sun.at(t)) # retrun E: print(sun.at(t).position) # retrun [-0.008965 0.00182226 0.00099967] au What is the difference between A and B? Or what is the difference between Geocentric ICRS position and ICRF position? A barycentric position measures from the Solar System’s center of mass. Why is the return value of E not zero? The solar system's center of mass is not the center of sun?

brandon-rhodes commented 2 years ago

What is the difference between A and B?

The two vectors should be of the same magnitude but point in opposite directions.

Or what is the difference between Geocentric ICRS position and ICRF position?

The ICRS and ICRF are the same coordinate frame; please point out if there's somewhere Skyfield could be more consistent in using the term ICRS.

A barycentric position measures from the Solar System’s center of mass. Why is the return value of E not zero? The solar system's center of mass is not the center of sun?

Because there are other masses in the Solar System besides the Sun. The center of mass includes everything in the Solar System, not just the Sun.