Geometry API¶
\(SO(3)\)¶
hatSO3 ¶
hatSO3(w: ndarray) -> jnp.ndarray
Map Euclidean vectors to skew-symmetric matrices in \(\mathfrak{so}(3)\).
The hat operator is defined so that matrix multiplication reproduces the three-dimensional cross product:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
w
|
(Array, shape(..., 3))
|
One vector or a batch of vectors. |
required |
Returns:
| Type | Description |
|---|---|
(Array, shape(..., 3, 3))
|
Skew-symmetric matrices with the same leading batch dimensions and
dtype as |
Notes
The function is compatible with jax.jit, automatic
differentiation, and arbitrary leading batch dimensions.
veeSO3 ¶
veeSO3(W: ndarray) -> jnp.ndarray
Map matrices in \(\mathfrak{so}(3)\) back to Euclidean vectors.
This is the inverse of hat for a skew-symmetric matrix:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
W
|
(Array, shape(..., 3, 3))
|
One matrix or a batch of matrices. Inputs are assumed to be skew-symmetric; this function does not validate or antisymmetrize them. |
required |
Returns:
| Type | Description |
|---|---|
(Array, shape(..., 3))
|
Vectors formed from entries |
expSO3 ¶
expSO3(w: ndarray) -> jnp.ndarray
Evaluate the exponential map from rotation vectors to \(SO(3)\).
For \(\theta=\lVert\mathbf{w}\rVert\) and \(W=\widehat{\mathbf{w}}\), Rodrigues' formula gives
The vector direction is the rotation axis and its norm is the rotation angle in radians. Near the identity, series expansions replace the two removable singularities in Rodrigues' formula.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
w
|
(Array, shape(..., 3))
|
Rotation vectors in radians. |
required |
Returns:
| Type | Description |
|---|---|
(Array, shape(..., 3, 3))
|
Proper rotation matrices with the same leading batch dimensions as
|
Raises:
| Type | Description |
|---|---|
ValueError
|
If the trailing shape of |
Notes
The small-angle and general branches remain finite during JAX automatic
differentiation, including exactly at w = 0.
logSO3 ¶
logSO3(R: ndarray) -> jnp.ndarray
Evaluate the principal logarithm of rotations in \(SO(3)\).
The result \(\mathbf{w}\) satisfies
Separate numerical paths are used near the identity and near
\(\pi\). The near-identity path avoids differentiating arccos at
one, while the near-\(\pi\) path recovers the rotation axis from the
symmetric part of R when its skew part becomes too small.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
R
|
(Array, shape(..., 3, 3))
|
One proper rotation matrix or a batch of proper rotation matrices. |
required |
Returns:
| Type | Description |
|---|---|
(Array, shape(..., 3))
|
Principal rotation vectors with the same leading batch dimensions as
|
Raises:
| Type | Description |
|---|---|
ValueError
|
If the trailing shape of |
Notes
log assumes that every input belongs to \(SO(3)\) and does not
validate orthogonality or determinant. Its value is undefined for an
improper or otherwise invalid rotation. Use log_checked for
host-side validation or is_proper_rotation inside transformed JAX
code.
The principal logarithm is discontinuous at rotations of angle \(\pi\); derivatives should be interpreted on one side of that branch cut.
is_proper_rotation ¶
is_proper_rotation(R: ndarray, atol: float = 1e-06) -> jnp.ndarray
Test whether matrices satisfy the defining conditions of \(SO(3)\).
A matrix is accepted when both
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
R
|
(Array, shape(..., 3, 3))
|
Matrices to test. |
required |
atol
|
float
|
Absolute tolerance applied independently to the orthogonality and
determinant errors. The default is |
1e-06
|
Returns:
| Type | Description |
|---|---|
jax.Array, shape (...,), dtype bool
|
One boolean result for each matrix. A scalar boolean array is returned
for a single |
Raises:
| Type | Description |
|---|---|
ValueError
|
If the trailing shape of |
Notes
Unlike log_checked, this function is suitable for use with
jax.jit, jax.vmap, and jax.lax.cond.
logSO3_checked ¶
logSO3_checked(R: ndarray, atol: float = 1e-06) -> jnp.ndarray
Evaluate the principal logarithm after validating membership in \(SO(3)\).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
R
|
(Array, shape(..., 3, 3))
|
One rotation matrix or a batch of rotation matrices. Every matrix must
pass |
required |
atol
|
float
|
Absolute tolerance used for both the orthogonality and determinant
checks. The default is |
1e-06
|
Returns:
| Type | Description |
|---|---|
(Array, shape(..., 3))
|
Principal rotation vectors returned by |
Raises:
| Type | Description |
|---|---|
ValueError
|
If the input shape is invalid or any input matrix fails validation. |
Notes
Validation converts the combined JAX boolean to a Python bool in order
to raise a normal exception. Consequently, log_checked is intended for
input boundaries, tests, and debugging rather than a JIT-compiled hot path.
Use is_proper_rotation when validation must remain inside JAX
transformations.
\(SE(3)\)¶
hatSE3 ¶
hatSE3(xi: ndarray) -> jnp.ndarray
Map twists to matrices in \(\mathfrak{se}(3)\).
SympLie orders a twist as \(\boldsymbol{\xi}=[\boldsymbol{\rho}, \boldsymbol{\phi}]\), with translation first and rotation second. The hat operator is
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
xi
|
(Array, shape(..., 6))
|
One twist or a batch of twists in |
required |
Returns:
| Type | Description |
|---|---|
(Array, shape(..., 4, 4))
|
Homogeneous Lie-algebra matrices with the same leading batch
dimensions and dtype as |
Raises:
| Type | Description |
|---|---|
ValueError
|
If the trailing shape of |
veeSE3 ¶
veeSE3(X: ndarray) -> jnp.ndarray
Map matrices in \(\mathfrak{se}(3)\) back to twists.
For a matrix
the result is the translation-first twist \([\boldsymbol{\rho},\boldsymbol{\phi}]\).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
X
|
(Array, shape(..., 4, 4))
|
One Lie-algebra matrix or a batch of matrices. The function assumes the expected \(\mathfrak{se}(3)\) structure and does not validate it. |
required |
Returns:
| Type | Description |
|---|---|
(Array, shape(..., 6))
|
Twists in |
Raises:
| Type | Description |
|---|---|
ValueError
|
If the trailing shape of |
expSE3 ¶
expSE3(xi: ndarray) -> jnp.ndarray
Evaluate the exponential map from twists to \(SE(3)\).
For the translation-first twist \(\boldsymbol{\xi}=[\boldsymbol{\rho},\boldsymbol{\phi}]\), SympLie constructs
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
xi
|
(Array, shape(..., 6))
|
Twists in |
required |
Returns:
| Type | Description |
|---|---|
(Array, shape(..., 4, 4))
|
Homogeneous transformation matrices with the same leading batch
dimensions as |
Raises:
| Type | Description |
|---|---|
ValueError
|
If the trailing shape of |
Notes
The implementation uses the numerically stable \(SO(3)\) exponential and left Jacobian, including their small-angle paths.
logSE3 ¶
logSE3(T: ndarray) -> jnp.ndarray
Evaluate the principal logarithm of transformations in \(SE(3)\).
For
the principal twist is
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
T
|
(Array, shape(..., 4, 4))
|
One homogeneous transformation or a batch of transformations. |
required |
Returns:
| Type | Description |
|---|---|
(Array, shape(..., 6))
|
Principal translation-first twists. The rotation-vector norm lies in \([0,\pi]\). |
Raises:
| Type | Description |
|---|---|
ValueError
|
If the trailing shape of |
Notes
log assumes that the rotational block is a proper rotation and that
the final row has homogeneous-transform structure. It does not validate
either condition. The rotational principal-branch behavior and branch cut
are inherited from symplie.so3.log.
left_jacobian_SO3 ¶
left_jacobian_SO3(phi: ndarray) -> jnp.ndarray
Evaluate the left Jacobian of \(SO(3)\).
For \(\theta=\lVert\boldsymbol{\phi}\rVert\) and \(\Phi=\widehat{\boldsymbol{\phi}}\), the Jacobian is
It maps the translational component of an \(\mathfrak{se}(3)\) twist to the translation in the corresponding homogeneous transform.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
phi
|
(Array, shape(..., 3))
|
Rotation vectors in radians. |
required |
Returns:
| Type | Description |
|---|---|
(Array, shape(..., 3, 3))
|
Left Jacobians with the same leading batch dimensions as |
Raises:
| Type | Description |
|---|---|
ValueError
|
If the trailing shape of |
Notes
A series expansion is used near zero. The implementation is compatible with JAX JIT compilation, batching, and automatic differentiation.
left_jacobian_inverse_SO3 ¶
left_jacobian_inverse_SO3(phi: ndarray) -> jnp.ndarray
Evaluate the inverse left Jacobian of \(SO(3)\).
For \(\theta=\lVert\boldsymbol{\phi}\rVert\) and \(\Phi=\widehat{\boldsymbol{\phi}}\), the inverse is
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
phi
|
(Array, shape(..., 3))
|
Rotation vectors in radians. |
required |
Returns:
| Type | Description |
|---|---|
(Array, shape(..., 3, 3))
|
Inverse left Jacobians with the same leading batch dimensions as
|
Raises:
| Type | Description |
|---|---|
ValueError
|
If the trailing shape of |
Notes
A series expansion is used near zero. This inverse is used by
log to recover the translational twist coordinate.