Description
Quaternion order is scalar-first [w,x,y,z], Hamilton product and right-handed active rotations; convert an explicit nonzero axis and angle to a unit quaternion; axis is normalized, radians are not silently clamped.
A quaternion has one scalar and three vector components. This family uses [w, x, y, z] unless a layout converter says otherwise. Unit quaternions can represent rotations, and q and −q describe the same rotation under this convention; component arithmetic and physical rotation interpretation are separate operations.
Quaternion order is scalar-first [w,x,y,z], Hamilton product and right-handed active rotations; convert an explicit nonzero axis and angle to a unit quaternion; axis is normalized, radians are not silently clamped.
When to use this tool
Use this tool to convert an explicit nonzero axis and angle to a unit quaternion; axis is normalized, radians are not silently clamped.
How to use the tool and how it works
- Enter axis, radians using the field definitions below.
- Run the operation. Correct input errors before interpreting an output.
- Read result.quaternion. Use the ordering, boundary rules and absence conditions described below.
Require a three-component axis with positive finite norm, normalize it, and return [cos(radians/2), axis × sin(radians/2)].1
| Input field | Meaning and units | Accepted input |
|---|---|---|
| axis | Three-component nonzero direction; normalized internally. | Dense list of at most 128 finite numbers; integer/shape constraints above also apply. |
| radians | Rotation angle in radians. | A finite number satisfying the operation’s stated comparisons. |
| Output field | Interpretation |
|---|---|
| result | Object containing the named fields below. |
| result.quaternion | Four result components in [w, x, y, z] order. |
{
"input": {
"axis": [
0,
0,
2
],
"radians": 0
},
"output": {
"result": {
"quaternion": [
1,
0,
0,
0
]
}
}
} Limitations and assumptions
- Angle is in radians and any finite angle is accepted; a zero axis is invalid even for zero angle.
- When an operation requires unit input, the fixed acceptance condition is |norm − 1| ≤ 1e−10. The norm audit instead uses its supplied tolerance. Angles use radians; vector units are preserved by a unit rotation. Floating-point roundoff is possible.
- Every declared top-level input field is required and unexpected fields are rejected. Ordinary strings are limited to 8,192 UTF-16 code units and lists to 128 entries, with tighter operation-specific bounds where stated. JSON text has bounded nesting and node counts.
- Numeric outputs must be finite and no larger in absolute magnitude than the safe-integer limit; operations returning exact large integers use decimal text. Positions are zero-based and spans end exclusively unless the operation explicitly states a different convention.
Alternative or Complementary methods
Confirm component layout, multiplication order and coordinate-frame convention before using another library’s records. Normalize only when appropriate, and distinguish component-space tolerances from angular tolerances.
References
Similar or alternative tools
- Unit Quaternion Record to Axis Angle
Quaternion order is scalar-first [w,x,y,z], Hamilton product and right-handed active rotations; convert a unit rotation to canonical shortest axis-angle; zero rotation has an unknown/null axis, not an invented direction.
- Unit Quaternion Basis Vector Images
Quaternion order is scalar-first [w,x,y,z], Hamilton product and right-handed active rotations; return the three active basis-vector images as columns-as-vectors, not a transposed row-major matrix convention.