initial commit
This commit is contained in:
30
modules/clocks/crt.py
Normal file
30
modules/clocks/crt.py
Normal file
@@ -0,0 +1,30 @@
|
||||
import datetime
|
||||
|
||||
from modules.clock import Clock
|
||||
|
||||
|
||||
class CRTClock(Clock):
|
||||
def __init__(
|
||||
self,
|
||||
R: tuple[
|
||||
tuple[float, float, float],
|
||||
tuple[float, float, float],
|
||||
tuple[float, float, float],
|
||||
],
|
||||
):
|
||||
self.R = R
|
||||
super().__init__()
|
||||
|
||||
def transform(self, time: datetime.datetime) -> tuple[float, float, float]:
|
||||
# normalize
|
||||
h = time.hour / 24.0
|
||||
m = time.minute / 60.0
|
||||
s = time.second / 60.0
|
||||
|
||||
ret = (
|
||||
h * self.R[0][0] + m * self.R[0][1] + s * self.R[0][2],
|
||||
h * self.R[1][0] + m * self.R[1][1] + s * self.R[1][2],
|
||||
h * self.R[2][0] + m * self.R[2][1] + s * self.R[2][2],
|
||||
)
|
||||
|
||||
return ret
|
||||
Reference in New Issue
Block a user