84 const Matrix3<T> fromAxes = getAxes(from.up, from.hand);
85 const Matrix3<T> toAxes = getAxes(to.up, to.hand);
88 return toAxes * fromAxes.transpose();
95 return unitInMeters<T>(from.
unit) / unitInMeters<T>(to.
unit);
102 const Matrix3<T> P = permutationMatrix<T>(from, to);
123 const Matrix3<T> P = permutationMatrix<T>(from, to);
124 return P * m * P.transpose();
Quaternion< T > changeQuaternion(const Quaternion< T > &q, const CoordinateSystem &from, const CoordinateSystem &to)
Converts a quaternion rotation between coordinate systems.
template float scaleFactor< float >(const CoordinateSystem &, const CoordinateSystem &)
Matrix3< T > fromMomentumRotationMatrix(const Matrix3< T > &m, const CoordinateSystem &to)
Converts a 3x3 rotation matrix from Momentum's canonical coordinate system into to.
Eigen::Matrix< T, 3, 3 > Matrix3
Vector3< T > toMomentumVector(const Vector3< T > &v, const CoordinateSystem &from)
Converts a position vector from from into Momentum's canonical coordinate system.
LengthUnit
Specifies the unit of length measurement.
Vector3< T > fromMomentumVector(const Vector3< T > &v, const CoordinateSystem &to)
Converts a position vector from Momentum's canonical coordinate system into to.
Quaternion< T > toMomentumQuaternion(const Quaternion< T > &q, const CoordinateSystem &from)
Converts a quaternion rotation from from into Momentum's canonical coordinate system.
Quaternion< T > fromMomentumQuaternion(const Quaternion< T > &q, const CoordinateSystem &to)
Converts a quaternion rotation from Momentum's canonical coordinate system into to.
Eigen::Quaternion< T > Quaternion
Unit quaternion representing a 3D rotation.
Handedness
Specifies the handedness (chirality) of a coordinate system.
template double scaleFactor< double >(const CoordinateSystem &, const CoordinateSystem &)
Matrix3< T > changeRotationMatrix(const Matrix3< T > &m, const CoordinateSystem &from, const CoordinateSystem &to)
Converts a 3x3 rotation matrix between coordinate systems.
UpAxis
Specifies which axis points "up" in a 3D coordinate system.
constexpr CoordinateSystem kMomentumCoordinateSystem
Momentum's canonical coordinate system: Y-up, right-handed, centimeters.
Vector3< T > changeVector(const Vector3< T > &v, const CoordinateSystem &from, const CoordinateSystem &to)
Converts a 3D position vector between coordinate systems.
T scaleFactor(const CoordinateSystem &from, const CoordinateSystem &to)
Returns the length scale factor when converting a length from from's unit to to's unit.
Matrix3< T > toMomentumRotationMatrix(const Matrix3< T > &m, const CoordinateSystem &from)
Converts a 3x3 rotation matrix from from into Momentum's canonical coordinate system.
A 3D coordinate system defined by its up axis, handedness, and length unit.