17#ifndef ROOT_Math_GenVector_AxisAngle
18#define ROOT_Math_GenVector_AxisAngle 1
62 template<
class AnyVector>
92 template <
class OtherRotation>
99 template <
class OtherRotation>
117 IT
a = begin; IT
b = ++begin; IT
c = ++begin;
121 assert (++begin==end);
124 if (tot > 0)
fAxis /= tot;
133 IT
a = begin; IT
b = ++begin; IT
c = ++begin;
137 assert (++begin==end);
157 template<
class AnyVector>
168 template<
class AnyVector>
195 template <
class CoordSystem,
class Tag>
201 vNew.
SetXYZ( rxyz.
X(), rxyz.
Y(), rxyz.
Z() );
208 template <
class CoordSystem,
class Tag>
219 template <
class CoordSystem>
234 template <
class ForeignVector>
239 return ForeignVector ( rxyz.
X(), rxyz.
Y(), rxyz.
Z() );
245 template <
class AVector>
308 static double Pi() {
return 3.14159265358979323; }
325AxisAngle
operator* (RotationX
const & r1, AxisAngle
const & r2);
326AxisAngle
operator* (RotationY
const & r1, AxisAngle
const & r2);
327AxisAngle
operator* (RotationZ
const & r1, AxisAngle
const & r2);
334std::ostream &
operator<< (std::ostream & os,
const AxisAngle &
a);
#define R(a, b, c, d, e, f, g, h, i)
typedef void((*Func_t)())
AxisAngle class describing rotation represented with direction axis (3D Vector) and an angle of rotat...
void SetComponents(IT begin, IT end)
Set the axis and then the angle given a pair of pointers or iterators defining the beginning and end ...
void GetComponents(IT begin, IT end) const
Get the axis and then the angle into data specified by an iterator begin and another to the end of th...
void Rectify()
Re-adjust components to eliminate small deviations from the axis being a unit vector and angles out o...
XYZVector operator()(const XYZVector &v) const
AVector operator*(const AVector &v) const
Overload operator * for rotation on a vector.
bool operator==(const AxisAngle &rhs) const
Equality/inequality operators.
void GetComponents(AnyVector &axis, Scalar &angle) const
Set components into a non-zero vector (x,y,z) and an angle.
AxisVector Axis() const
accesss to rotation axis
Scalar Angle() const
access to rotation angle
Scalar Distance(const R &r) const
Distance between two rotations.
DisplacementVector3D< Cartesian3D< Scalar > > AxisVector
definition of vector axis
void SetComponents(const AnyVector &v, Scalar angle)
Set components from a non-zero vector (x,y,z) and an angle.
DisplacementVector3D< Cartesian3D< double >, DefaultCoordinateSystemTag > XYZVector
Rotation operation on a cartesian vector.
AxisAngle(const AnyVector &v, Scalar angle)
Construct from a non-zero vector (x,y,z) and an angle.
AxisAngle Inverse() const
Return inverse of an AxisAngle rotation.
AxisAngle(const OtherRotation &r)
Construct from another supported rotation type (see gv_detail::convert )
AxisAngle()
Default constructor (axis is z and angle is zero)
void GetComponents(IT begin) const
Get the axis and then the angle into data specified by an iterator begin.
bool operator!=(const AxisAngle &rhs) const
void Invert()
Invert an AxisAngle rotation in place.
AxisAngle & operator=(OtherRotation const &r)
Assign from another supported rotation type (see gv_detail::convert )
AxisAngle & operator*=(const R &r)
Post-Multiply (on right) by another rotation : T = T*R.
AxisAngle(IT begin, IT end)
Construct given a pair of pointers or iterators defining the beginning and end of an array of four Sc...
DefaultCoordinateSystemTag Default tag for identifying any coordinate system.
Class describing a generic displacement vector in 3 dimensions.
Scalar R() const
Polar R, converting if necessary from internal coordinate system.
Scalar X() const
Cartesian X, converting if necessary from internal coordinate system.
void GetCoordinates(Scalar &a, Scalar &b, Scalar &c) const
get internal data into 3 Scalar numbers
Scalar Y() const
Cartesian Y, converting if necessary from internal coordinate system.
DisplacementVector3D< CoordSystem, Tag > & SetCoordinates(const Scalar src[])
Set internal data based on a C-style array of 3 Scalar numbers.
DisplacementVector3D< CoordSystem, Tag > & SetXYZ(Scalar a, Scalar b, Scalar c)
set the values of the vector from the cartesian components (x,y,z) (if the vector is held in polar or...
Scalar Z() const
Cartesian Z, converting if necessary from internal coordinate system.
EulerAngles class describing rotation as three angles (Euler Angles).
Class describing a generic position vector (point) in 3 dimensions.
Rotation class with the (3D) rotation represented by a unit quaternion (u, i, j, k).
Rotation class with the (3D) rotation represented by a 3x3 orthogonal matrix.
Rotation class representing a 3D rotation about the X axis by the angle of rotation.
Rotation class representing a 3D rotation about the Y axis by the angle of rotation.
Rotation class with the (3D) rotation represented by angles describing first a rotation of an angle p...
Rotation class representing a 3D rotation about the Z axis by the angle of rotation.
Namespace for new Math classes and functions.
double dist(Rotation3D const &r1, Rotation3D const &r2)
void convert(R1 const &, R2 const)
std::ostream & operator<<(std::ostream &os, const AxisAngle &a)
Stream Output and Input.
AxisAngle operator*(RotationX const &r1, AxisAngle const &r2)
Multiplication of an axial rotation by an AxisAngle.
AxisAngle::Scalar Distance(const AxisAngle &r1, const R &r2)
Distance between two rotations.