Simplify normalize_mirror

This commit is contained in:
jan 2019-05-20 21:04:31 -07:00
parent 0ab5674fb9
commit 2c9af3f63f

View File

@ -59,15 +59,8 @@ def rotation_matrix_2d(theta: float) -> numpy.ndarray:
def normalize_mirror(mirrored: Tuple[bool, bool]) -> Tuple[bool, float]: def normalize_mirror(mirrored: Tuple[bool, bool]) -> Tuple[bool, float]:
mirrored_x, mirrored_y = mirrored mirrored_x, mirrored_y = mirrored
if mirrored_x and mirrored_y: mirror_x = (mirrored_x != mirrored_y) #XOR
angle = numpy.pi angle = numpy.pi if mirrored_y else 0
mirror_x = False
elif mirrored_x:
angle = 0
mirror_x = True
elif mirror_y:
angle = numpy.pi
mirror_x = True
return mirror_x, angle return mirror_x, angle