Skip to content

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

data SO3 Source #

Normalized representative of SO(3).

Instances

Instances details
Show SO3 Source # 
Instance details

Defined in HMath.Rotation

Methods

showsPrec :: Int -> SO3 -> ShowS #

show :: SO3 -> String #

showList :: [SO3] -> ShowS #

Eq SO3 Source # 
Instance details

Defined in HMath.Rotation

Methods

(==) :: SO3 -> SO3 -> Bool #

(/=) :: SO3 -> SO3 -> Bool #

so3

so3 :: Quaternion -> Either MathError SO3 Source #

Normalize a nonzero quaternion into SO(3).

rotationQuaternion

rotationQuaternion :: SO3 -> Quaternion Source #

Underlying unit Hamilton quaternion.

identityRotation

identityRotation :: SO3 Source #

Identity rotation.

composeRotation

composeRotation :: SO3 -> SO3 -> Either MathError SO3 Source #

Composition applying the right rotation first.

inverseRotation

inverseRotation :: SO3 -> SO3 Source #

Inverse of a unit rotation.

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.

logSO3

logSO3 :: SO3 -> Either MathError [Double] Source #

Principal logarithm as a rotation vector.

SE3

data SE3 Source #

Rigid transformation x -> R*x+t.

Instances

Instances details
Show SE3 Source # 
Instance details

Defined in HMath.Rotation

Methods

showsPrec :: Int -> SE3 -> ShowS #

show :: SE3 -> String #

showList :: [SE3] -> ShowS #

Eq SE3 Source # 
Instance details

Defined in HMath.Rotation

Methods

(==) :: SE3 -> SE3 -> Bool #

(/=) :: SE3 -> SE3 -> Bool #

se3

se3 :: SO3 -> [Double] -> Either MathError SE3 Source #

Construct a rigid transform from a rotation and finite translation.

rotationPart

rotationPart :: SE3 -> SO3 Source #

Rotation component.

translationPart

translationPart :: SE3 -> [Double] Source #

Translation component.

identityTransform

identityTransform :: SE3 Source #

Identity rigid transform.

compose

compose :: SE3 -> SE3 -> Either MathError SE3 Source #

Compose transforms; b acts first.

inverse

inverse :: SE3 -> Either MathError SE3 Source #

Inverse rigid transform.

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

Instances details
Show DualQuaternion Source # 
Instance details

Defined in HMath.Rotation

Eq DualQuaternion Source # 
Instance details

Defined in HMath.Rotation

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].