Add R90 and R180 constants for rotation shorthand

This commit is contained in:
Jan Petykiewicz 2025-03-12 23:04:51 -07:00
parent 6567394fbf
commit 6c76e1f5cf
3 changed files with 9 additions and 0 deletions

View File

@ -83,6 +83,8 @@ from .builder import (
from .utils import (
ports2data as ports2data,
oneshot as oneshot,
R90 as R90,
R180 as R180,
)

View File

@ -25,6 +25,8 @@ from .transform import (
normalize_mirror as normalize_mirror,
rotate_offsets_around as rotate_offsets_around,
apply_transforms as apply_transforms,
R90 as R90,
R180 as R180,
)
from .comparisons import (
annotation2key as annotation2key,

View File

@ -9,6 +9,11 @@ from numpy.typing import NDArray, ArrayLike
from numpy import pi
# Constants for shorthand rotations
R90 = pi / 2
R180 = pi
@lru_cache
def rotation_matrix_2d(theta: float) -> NDArray[numpy.float64]:
"""