I'm trying to represent coordinate systems (and transformations between them) in arbitrary dimensions. A coordinate system can be described by its pose (position + orientation) and I am unsure how to best represent its orientation in arbitrary dimensions.
Based on my search, it should be possible to represent an arbitrary pose as a sequence of rotations (source). Further, it should be possible to represent an arbitrary rotation by an angle (amount to rotate), and a plane in which to rotate (source). This means I should be able to do something like this in code
from dataclasses import dataclass
from typing import List
from numpy.typing import ArrayLike
@dataclass
class Rotation:
# amount to rotate
alpha: float
# two vectors spanning the plane
u: ArrayLike
v: ArrayLike
@dataclass
class Orientation:
orientation: List[Rotation]
This seems quite naive and inefficient. Each rotation has to be applied one at a time, which may not be very efficient computationally speaking. It is also non-unique. For example, these three objects represent the same orientation
Orientation(Rotation(np.pi, (0, 1), (1, 0)))
Orientation(Rotation(-np.pi, (1, 0), (0, 1)))
Orientation([Rotation(np.pi, (0, 1), (1, 0)), Rotation(0.42, (0, 1), (1, 0)), Rotation(-0.42, (0, 1), (1, 0))])
How can I improve this and what is the best data structure to use here?