mirror of
https://github.com/cosinekitty/astronomy.git
synced 2026-05-19 06:17:03 -04:00
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:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user