Formatting

This commit is contained in:
2026-01-15 18:36:56 +01:00
parent ac73cfcf5e
commit e6ce15aee9
7 changed files with 43 additions and 40 deletions

View File

@@ -1,3 +1,8 @@
"""
When theta motor is at 0 then mirror is up and when at 180 then mirror is front.
Phi 0 equals right and phi 180 equals left by 45 degrees.
"""
import numpy as np
from objects.generic import Source, Target
@@ -5,9 +10,10 @@ from objects.motor import Motor
from calculator import get_angles
class Mirror:
def __init__(self, world, cluster_x=0, cluster_y=0):
self.world = world
self.world = world # TODO: Fix this cyclic reference
self.cluster_x = cluster_x
self.cluster_y = cluster_y
@@ -32,7 +38,7 @@ class Mirror:
rel_source = source.pos - rot_pos
rel_target = target.pos - rot_pos
phi, theta = get_angles(rel_source, rel_target) # ty:ignore[unresolved-reference]
phi, theta = get_angles(rel_source, rel_target)
# Update the angles based on the normals in rotated positions
self.motor_phi.set_angle(phi)

View File

@@ -53,3 +53,4 @@ class World:
y_rot = y
z_rot = -x * sin_t + z * cos_t
return np.array([x_rot, y_rot, z_rot])