A correct equation can still encode the wrong rotation
Conventions are part of the API.
Quaternion multiplication order, active versus passive interpretation, frame direction, and Euler sequence cannot be left to caller intuition. Downstream estimation and control code must consume the same contract.
| Contract | What callers must establish | Failure if ambiguous |
|---|---|---|
| Quaternion layout | Scalar-first [w,x,y,z] wherever the public API declares quaternion arrays | Valid-looking but incorrect rotations |
| Composition | Current-to-target correction and multiplication direction are named at the call site | Controller commands rotate away from the target |
| Euler order | The supported intrinsic/extrinsic sequence is explicit | Different orientation from identical angles |
| DCM validity | Orthonormality, determinant, finite values, and reflection rejection are checked | Malformed matrices silently become orientation state |
| Units | Angles use radians inside numerical APIs unless explicitly converted | Scale errors survive compilation |
The exact accepted contract is enforced by checked functions and fixtures. Documentation describes that contract; tests decide whether an implementation still satisfies it.