Skip to content

Commit

Permalink
Irresponsibly add “-position” without any tests
Browse files Browse the repository at this point in the history
I added it a few minutes ago for a script that then wound up not needing
it.  But while I’ve got it here it would seem a waste to delete it.
  • Loading branch information
brandon-rhodes committed Feb 3, 2020
1 parent 41cfa18 commit 482f1ce
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions skyfield/positionlib.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,17 @@ def __getitem__(self, i):
#self.observer_data,
)

def __neg__(self):
return type(self)(
-self.position.au,
-self.velocity.au_per_d,
self.t,
self.target,
self.center,
# TODO: figure out how to invert observer data
#self.observer_data,
)

def distance(self):
"""Compute the distance from the origin to this position.
Expand Down

0 comments on commit 482f1ce

Please sign in to comment.