HMath.Rotation¶
Module index · Numerical conventions
Description
SO(3), SE(3), and rigid dual quaternions. Active right-handed transforms
act on column vectors; compose a b applies b first. Translation shares the
coordinate unit of points, angles are radians, and twists are (omega,v).
SO(3) logs choose angles in [0,pi]; pi-axis sign is the quaternion convention.
SE(3) exp/log use the SO(3) left Jacobian, with series near identity. Dual
quaternion interpolation is screw-linear ScLERP through SE(3), including the
pure-translation limit. These APIs model rigid transforms, not scale/shear.
On this page¶
| API | Purpose |
|---|---|
| SO3 | Normalized representative of SO(3). |
| so3 | Normalize a nonzero quaternion into SO(3). |
| rotationQuaternion | Underlying unit Hamilton quaternion. |
| identityRotation | Identity rotation. |
| composeRotation | Composition applying the right rotation first. |
| inverseRotation | Inverse of a unit rotation. |
| rotate | Apply a rotation to a finite three-vector. |
| expSO3 | Exponential of a rotation vector; vector norm is the angle in radians. |
| logSO3 | Principal logarithm as a rotation vector. |
| SE3 | Rigid transformation x -> R*x+t. |
| se3 | Construct a rigid transform from a rotation and finite translation. |
| rotationPart | Rotation component. |
| translationPart | Translation component. |
| identityTransform | Identity rigid transform. |
| compose | Compose transforms; b acts first. |
| inverse | Inverse rigid transform. |
| transformPoint | Apply a rigid transform. |
| expSE3 | SE(3) exponential. |
| logSE3 | Principal SE(3) logarithm, stable at identity and at rotations near pi. |
| toHomogeneous | Row-major homogeneous 4x4 matrix, bottom row [0,0,0,1]. |
| fromHomogeneous | Validate a homogeneous rigid matrix (bottom row tolerance 1e-12, rotation 1e-9). |
| DualQuaternion | Unit real part and Study-orthogonal dual part. |
| dualQuaternion | Construct a rigid dual quaternion. |
| dualParts | Real and dual Hamilton parts. |
| toDualQuaternion | Encode translation as 0.5(0,t)r. |
| fromDualQuaternion | Decode translation from 2dconjugate(r). |
| multiplyDual | Rigid dual-quaternion product. |
| inverseDual | Inverse rigid dual quaternion. |
| interpolateDual | Shortest-rotation screw-linear interpolation on [0,1]. |
Documentation
SO3
Normalized representative of SO(3).
rotationQuaternion
rotationQuaternion :: SO3 -> Quaternion Source #
Underlying unit Hamilton quaternion.
composeRotation
composeRotation :: SO3 -> SO3 -> Either MathError SO3 Source #
Composition applying the right rotation first.
rotate
rotate :: SO3 -> [Double] -> Either MathError [Double] Source #
Apply a rotation to a finite three-vector.
expSO3
expSO3 :: [Double] -> Either MathError SO3 Source #
Exponential of a rotation vector; vector norm is the angle in radians.
SE3
Rigid transformation x -> R*x+t.
se3
se3 :: SO3 -> [Double] -> Either MathError SE3 Source #
Construct a rigid transform from a rotation and finite translation.
transformPoint
transformPoint :: SE3 -> [Double] -> Either MathError [Double] Source #
Apply a rigid transform.
expSE3
expSE3 :: ([Double], [Double]) -> Either MathError SE3 Source #
SE(3) exponential. The translational twist v is integrated by J(omega).
logSE3
logSE3 :: SE3 -> Either MathError ([Double], [Double]) Source #
Principal SE(3) logarithm, stable at identity and at rotations near pi.
toHomogeneous
toHomogeneous :: SE3 -> Either MathError (Matrix Double) Source #
Row-major homogeneous 4x4 matrix, bottom row [0,0,0,1].
fromHomogeneous
fromHomogeneous :: Matrix Double -> Either MathError SE3 Source #
Validate a homogeneous rigid matrix (bottom row tolerance 1e-12, rotation 1e-9).
DualQuaternion
data DualQuaternion Source #
Unit real part and Study-orthogonal dual part.
Instances
| Show DualQuaternion Source # | |
Defined in HMath.Rotation Methods showsPrec :: Int -> DualQuaternion -> ShowS # show :: DualQuaternion -> String # showList :: [DualQuaternion] -> ShowS # | |
| Eq DualQuaternion Source # | |
Defined in HMath.Rotation Methods (==) :: DualQuaternion -> DualQuaternion -> Bool # (/=) :: DualQuaternion -> DualQuaternion -> Bool # | |
dualQuaternion
dualQuaternion :: Quaternion -> Quaternion -> Either MathError DualQuaternion Source #
Construct a rigid dual quaternion. Real norm must be nonzero; both parts are scaled together and the Study dot-product condition checked at 1e-9.
dualParts
dualParts :: DualQuaternion -> (Quaternion, Quaternion) Source #
Real and dual Hamilton parts.
toDualQuaternion
toDualQuaternion :: SE3 -> Either MathError DualQuaternion Source #
Encode translation as 0.5*(0,t)*r.
fromDualQuaternion
fromDualQuaternion :: DualQuaternion -> Either MathError SE3 Source #
Decode translation from 2*d*conjugate(r).
multiplyDual
multiplyDual :: DualQuaternion -> DualQuaternion -> Either MathError DualQuaternion Source #
Rigid dual-quaternion product.
inverseDual
inverseDual :: DualQuaternion -> Either MathError DualQuaternion Source #
Inverse rigid dual quaternion.
interpolateDual
interpolateDual :: Double -> DualQuaternion -> DualQuaternion -> Either MathError DualQuaternion Source #
Shortest-rotation screw-linear interpolation on [0,1].