25 #ifndef FIBER_AXIS_ANGLE_H_
26 #define FIBER_AXIS_ANGLE_H_
32 template <
typename Scalar>
39 template <
typename Derived>
53 static_assert(Exp::SIZE_ == 3,
54 "Cannot set an axis from a vector with size other than 3");
72 template <
typename Scalar,
int Axis>
74 :
public _RValue<Scalar, CoordinateAxis<Scalar, Axis> > {
87 static_assert(0 <= Axis && Axis < 3,
88 "A primitive axis must have axis 0, 1, or 2");
92 return (i == Axis) ? Scalar(1.0) : Scalar(0.0);
97 return (i == Axis) ? Scalar(1.0) : Scalar(0.0);
102 template <
typename Scalar,
int Axis>
156 #endif // FIBER_AXISANGLE_H_
CoordinateAxis< float, 0 > AxisXf
A 3x1 normal vector with one unity element.
CoordinateAxis< double, 1 > AxisYd
CoordinateAxis< float, 1 > AxisYf
void QuaternionToAxisAngle(const Quaternion< Scalar > &q, fiber::_LValue< Scalar, Exp > *axis, Scalar *angle)
expression template for rvalues
const AxisType & GetAxis() const
CoordinateAxis< Scalar, Axis > GetAxis() const
CoordinateAxis< float, 2 > AxisZf
AxisAngle(const Quaternion< Scalar > &q)
AxisAngle(const _RValue< Scalar, Derived > &axis, Scalar angle)
void SetAxis(const _RValue< Scalar, Exp > &axis)
void SetAngle(const Scalar angle)
Quaternion< Scalar > ToQuaternion() const
CoordinateAxisAngle< float, 0 > CoordinateAxisAngleXf
CoordinateAxisAngle< double, 0 > CoordinateAxisAngleXd
CoordinateAxisAngle< float, 2 > CoordinateAxisAngleZf
AxisAngle< float > AxisAnglef
void CoordinateAxisAngleToQuaternion(const CoordinateAxisAngle< Scalar, Axis > &axis_angle, Quaternion< Scalar > *q)
CoordinateAxis< double, 0 > AxisXd
Matrix< Scalar, 3, 1 > AxisType
CoordinateAxisAngle< float, 1 > CoordinateAxisAngleYf
CoordinateAxis< double, 2 > AxisZd
Scalar operator()(Index i, Index j) const
An axis angle rotation about a coordinate axis.
CoordinateAxisAngle(Scalar angle)
AxisAngle< double > AxisAngled
CoordinateAxisAngle< double, 2 > CoordinateAxisAngleZd
Encodes a rotation in 3-dimensions by an return RView<Scalar, Exp, rows, Exp::COLS>(static_cast<Exp c...
Scalar operator[](Index i) const
void SetAngle(Scalar angle)
_LValue< Scalar, Exp > & LValue(_LValue< Scalar, Exp > &exp)
Explicitly expose _LValue of an expressions, can be used to help the compiler disambiguate overloads...
CoordinateAxisAngle< double, 1 > CoordinateAxisAngleYd