warp.quaternion#
- warp.quaternion(dtype: Float = ...) Quaternion[Float]#
Construct a zero-initialized quaternion.
Quaternions store their components in
(x, y, z, w)order, wherex,y, andzform the vector (imaginary) part andwis the scalar (real) part. For the identity rotation, usequat_identity().- Parameters:
dtype – Scalar type of the components. Defaults to
float32.- Returns:
The quaternion
(0, 0, 0, 0).
- warp.quaternion( ) Quaternion[Float]
Construct a quaternion from its components.
All arguments must have the same scalar type, which must match
dtypewhen it is given.- Parameters:
x –
xcomponent of the vector (imaginary) part.y –
ycomponent of the vector (imaginary) part.z –
zcomponent of the vector (imaginary) part.w – Scalar (real) part.
dtype – Scalar type of the components, inferred from the other arguments when omitted.
- Returns:
The quaternion
(x, y, z, w).
- warp.quaternion( ) Quaternion[Float]
Construct a quaternion from its vector and scalar parts.
All arguments must have the same scalar type, which must match
dtypewhen it is given.- Parameters:
ijk – Vector (imaginary) part, stored as the
x,y, andzcomponents.real – Scalar (real) part, stored as the
wcomponent.dtype – Scalar type of the components, inferred from the other arguments when omitted.
- Returns:
The quaternion
(ijk[0], ijk[1], ijk[2], real).
- warp.quaternion( ) Quaternion[Float]
Construct a copy of a quaternion, optionally converting its scalar type.
- Parameters:
quat – Quaternion to copy.
dtype – Scalar type of the result. Defaults to the scalar type of
quat.
- Returns:
A quaternion with the components of
quat, converted todtype.