Work in progress: Python demo of searching for pair longitudes.

Started work on a Python demo for finding when the moon
reaches relative longitudes with other solar system bodies
that are multiples of 30 degrees. It is not finished yet,
but getting close.

Added operator overloads for the Python Time class so
that times can be compared against each other.
This makes it easier to sort a list of times, for example.
This commit is contained in:
Don Cross
2021-04-27 22:08:24 -04:00
parent a8a3342a2f
commit 7ef9f71810
5 changed files with 149 additions and 0 deletions

View File

@@ -713,6 +713,24 @@ class Time:
self.etilt = _e_tilt(self)
return self.etilt
def __lt__(self, other):
return self.tt < other.tt
def __eq__(self, other):
return self.tt == other.tt
def __le__(self, other):
return self.tt <= other.tt
def __ne__(self, other):
return self.tt != other.tt
def __gt__(self, other):
return self.tt > other.tt
def __ge__(self, other):
return self.tt >= other.tt
class Observer:
"""Represents the geographic location of an observer on the surface of the Earth.