- 
                Notifications
    You must be signed in to change notification settings 
- Fork 96
spatial math types
        Peter Corke edited this page Feb 27, 2023 
        ·
        1 revision
      
    The module base/types.py defines a set of types for different arrays.  These are all ndarray but giving them more meaningful types is helpful when writing code.  The defined types are:
1D arrays for input to functions
- 
ArrayLikePurearray like of arbitrary length, eg. `np.r_[1, 2, 3], [1], (1, 2, 3, 4)
- 
ArrayLikearray like of arbitrary length including scalar, eg.2, np.r_[2], [2], (2,)
- 
ArrayLike2array like of length 2, eg.np.r_[1, 2], [1, 2], (1, 2)
- 
ArrayLike3array like of length 3, eg.np.r_[1, 2, 3], [1, 2, 3], (1, 2, 3)
- 
ArrayLike4array like of length 4, eg.np.r_[1, 2, 3, 4], [1, 2, 3, 4], (1, 2, 3, 4)
- 
ArrayLike6array like of length 6
Real vectors
- 
R1is a 1Dndarray$\sim \mathbb{R}^1$ 
- 
R2is a 1Dndarray$\sim \mathbb{R}^2$ 
- 
R3is a 1Dndarray$\sim \mathbb{R}^3$ 
- 
R4is a 1Dndarray$\sim \mathbb{R}^4$ 
- 
R6is a 1Dndarray$\sim \mathbb{R}^6$ 
- 
R8is a 1Dndarray$\sim \mathbb{R}^8$ 
Real matrices
- 
R1x1$\sim \mathbb{R}^{1\times 1}$ 
- 
R2x2$\sim \mathbb{R}^{2\times 2}$ 
- 
R3x3$\sim \mathbb{R}^{3\times 3}$ 
- 
R4x4$\sim \mathbb{R}^{4\times 4}$ 
- 
R6x6$\sim \mathbb{R}^{6\times 6}$ 
- 
R8x8$\sim \mathbb{R}^{8\times 8}$ 
- 
R1x3$\sim \mathbb{R}^{1\times 3}$ 
- 
R3x1$\sim \mathbb{R}^{3\times 1}$ 
- 
R1x2$\sim \mathbb{R}^{1\times 2}$ 
- 
R2x1$\sim \mathbb{R}^{2\times 1}$ 
Points
- 
Points22D points, columnise,$\sim \mathbb{R}^{2\times N}$ 
- 
Points32D points, columnise,$\sim \mathbb{R}^{3\times N}$ 
- 
RNx3$\sim \mathbb{R}^{N\times 3}$ 
Lie groups
- 
SO2Array2D rotation matrix, element of$\mbox{SO(2)} \subset \mathbb{R}^{2\times 2}$ 
- 
SE2Array2D rigid-body transformation matrix, element of$\mbox{SE(2)} \subset \mathbb{R}^{3\times 3}$ 
- 
SO3Array3D rotation matrix, element of$\mbox{SO(3)} \subset \mathbb{R}^{3\times 3}$ 
- 
SE3Array3D rigid-body transformation matrix, element of$\mbox{SE(32)} \subset \mathbb{R}^{4\times 4}$ 
Lie algebras, skew and augmented skew matrices
- 
so2ArrayLie algebra of$\mbox{SO(2)} \subset \mathbb{R}^{2\times 2}$ 
- 
se2ArrayLie algebra of$\mbox{SE(2)} \subset \mathbb{R}^{3\times 3}$ 
- 
so3ArrayLie algebra of$\mbox{SO(3)} \subset \mathbb{R}^{3\times 3}$ 
- 
se3ArrayLie algebra of$\mbox{SE(32)} \subset \mathbb{R}^{4\times 4}$ 
Quaternions
- 
QuaternionArrayquaternion, element of$\mathbb{H} \sim \mathbb{R}^4$ 
- 
UnitQuaternionArrayunit quaternion, element of${\rm S}^3 \subset \mathbb{R}^4$ 
2D and 3D unions
- Rn = R2 | R3
- SOnArray = SO2Array | SO3Array
- SEnArray = SE2Array | SE3Array
- sonArray = so2Array | so3Array
- senArray = se2Array | se3Array