Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
ROOT::ROOT_MATH_ARCH::AxisAngle Class Reference

AxisAngle class describing rotation represented with direction axis (3D Vector) and an angle of rotation around that axis.

See also
Physics Vectors

Definition at line 46 of file AxisAngle.h.

Public Types

typedef DisplacementVector3D< Cartesian3D< Scalar > > AxisVector
 definition of vector axis
 
typedef double Scalar
 
typedef DisplacementVector3D< Cartesian3D< double >, DefaultCoordinateSystemTagXYZVector
 Rotation operation on a cartesian vector.
 

Public Member Functions

 AxisAngle ()
 Default constructor (axis is z and angle is zero)
 
template<class AnyVector >
 AxisAngle (const AnyVector &v, Scalar angle)
 Construct from a non-zero vector (x,y,z) and an angle.
 
template<class OtherRotation >
 AxisAngle (const OtherRotation &r)
 Construct from another supported rotation type (see gv_detail::convert )
 
template<class IT >
 AxisAngle (IT begin, IT end)
 Construct given a pair of pointers or iterators defining the beginning and end of an array of four Scalars, to be treated as the x, y, and z components of a unit axis vector, and the angle of rotation.
 
Scalar Angle () const
 access to rotation angle
 
AxisVector Axis () const
 access to rotation axis
 
template<class R >
Scalar Distance (const R &r) const
 Distance between two rotations.
 
template<class AnyVector >
void GetComponents (AnyVector &axis, Scalar &angle) const
 Set components into a non-zero vector (x,y,z) and an angle.
 
template<class IT >
void GetComponents (IT begin) const
 Get the axis and then the angle into data specified by an iterator begin.
 
template<class IT >
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 the desired data (4 past start).
 
AxisAngle Inverse () const
 Return inverse of an AxisAngle rotation.
 
void Invert ()
 Invert an AxisAngle rotation in place.
 
bool operator!= (const AxisAngle &rhs) const
 
template<class CoordSystem , class Tag >
DisplacementVector3D< CoordSystem, Tagoperator() (const DisplacementVector3D< CoordSystem, Tag > &v) const
 Rotation operation on a displacement vector in any coordinate system.
 
template<class ForeignVector >
ForeignVector operator() (const ForeignVector &v) const
 Rotation operation on an arbitrary vector v.
 
template<class CoordSystem >
LorentzVector< CoordSystem > operator() (const LorentzVector< CoordSystem > &v) const
 Rotation operation on a Lorentz vector in any 4D coordinate system.
 
template<class CoordSystem , class Tag >
PositionVector3D< CoordSystem, Tagoperator() (const PositionVector3D< CoordSystem, Tag > &p) const
 Rotation operation on a position vector in any coordinate system.
 
XYZVector operator() (const XYZVector &v) const
 
template<class AVector >
AVector operator* (const AVector &v) const
 Overload operator * for rotation on a vector.
 
AxisAngle operator* (const AxisAngle &a) const
 
AxisAngle operator* (const EulerAngles &e) const
 
AxisAngle operator* (const Quaternion &q) const
 
AxisAngle operator* (const Rotation3D &r) const
 Multiply (combine) two rotations.
 
AxisAngle operator* (const RotationX &rx) const
 
AxisAngle operator* (const RotationY &ry) const
 
AxisAngle operator* (const RotationZ &rz) const
 
AxisAngle operator* (const RotationZYX &r) const
 
template<class R >
AxisAngleoperator*= (const R &r)
 Post-Multiply (on right) by another rotation : T = T*R.
 
template<class OtherRotation >
AxisAngleoperator= (OtherRotation const &r)
 Assign from another supported rotation type (see gv_detail::convert )
 
bool operator== (const AxisAngle &rhs) const
 Equality/inequality operators.
 
void Rectify ()
 Re-adjust components to eliminate small deviations from the axis being a unit vector and angles out of the canonical range (-pi,pi].
 
template<class AnyVector >
void SetComponents (const AnyVector &v, Scalar angle)
 Set components from a non-zero vector (x,y,z) and an angle.
 
template<class IT >
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 of an array of four Scalars.
 

Private Member Functions

void RectifyAngle ()
 

Static Private Member Functions

static double Pi ()
 

Private Attributes

Scalar fAngle
 
AxisVector fAxis
 

#include <MathX/GenVectorX/AxisAngle.h>

Member Typedef Documentation

◆ AxisVector

◆ Scalar

◆ XYZVector

Constructor & Destructor Documentation

◆ AxisAngle() [1/4]

ROOT::ROOT_MATH_ARCH::AxisAngle::AxisAngle ( )
inline

Default constructor (axis is z and angle is zero)

Definition at line 59 of file AxisAngle.h.

◆ AxisAngle() [2/4]

template<class AnyVector >
ROOT::ROOT_MATH_ARCH::AxisAngle::AxisAngle ( const AnyVector & v,
Scalar angle )
inline

Construct from a non-zero vector (x,y,z) and an angle.

Precondition: the Vector needs to implement x(), y(), z(), and unit()

Definition at line 66 of file AxisAngle.h.

◆ AxisAngle() [3/4]

template<class IT >
ROOT::ROOT_MATH_ARCH::AxisAngle::AxisAngle ( IT begin,
IT end )
inline

Construct given a pair of pointers or iterators defining the beginning and end of an array of four Scalars, to be treated as the x, y, and z components of a unit axis vector, and the angle of rotation.

Precondition: The first three components are assumed to represent the rotation axis vector and the 4-th the rotation angle. The angle is assumed to be in the range (-pi,pi]. The axis vector is automatically normalized to be a unit vector

Definition at line 81 of file AxisAngle.h.

◆ AxisAngle() [4/4]

template<class OtherRotation >
ROOT::ROOT_MATH_ARCH::AxisAngle::AxisAngle ( const OtherRotation & r)
inlineexplicit

Construct from another supported rotation type (see gv_detail::convert )

Definition at line 100 of file AxisAngle.h.

Member Function Documentation

◆ Angle()

Scalar ROOT::ROOT_MATH_ARCH::AxisAngle::Angle ( ) const
inline

access to rotation angle

Definition at line 202 of file AxisAngle.h.

◆ Axis()

AxisVector ROOT::ROOT_MATH_ARCH::AxisAngle::Axis ( ) const
inline

access to rotation axis

Definition at line 197 of file AxisAngle.h.

◆ Distance()

template<class R >
Scalar ROOT::ROOT_MATH_ARCH::AxisAngle::Distance ( const R & r) const
inline

Distance between two rotations.

Definition at line 312 of file AxisAngle.h.

◆ GetComponents() [1/3]

template<class AnyVector >
void ROOT::ROOT_MATH_ARCH::AxisAngle::GetComponents ( AnyVector & axis,
Scalar & angle ) const
inline

Set components into a non-zero vector (x,y,z) and an angle.

The vector is intended to be a cartesian displacement vector but any vector class assignable from one will work.

Definition at line 188 of file AxisAngle.h.

◆ GetComponents() [2/3]

template<class IT >
void ROOT::ROOT_MATH_ARCH::AxisAngle::GetComponents ( IT begin) const
inline

Get the axis and then the angle into data specified by an iterator begin.

Definition at line 161 of file AxisAngle.h.

◆ GetComponents() [3/3]

template<class IT >
void ROOT::ROOT_MATH_ARCH::AxisAngle::GetComponents ( IT begin,
IT end ) const
inline

Get the axis and then the angle into data specified by an iterator begin and another to the end of the desired data (4 past start).

Definition at line 146 of file AxisAngle.h.

◆ Inverse()

AxisAngle ROOT::ROOT_MATH_ARCH::AxisAngle::Inverse ( ) const
inline

Return inverse of an AxisAngle rotation.

Definition at line 278 of file AxisAngle.h.

◆ Invert()

void ROOT::ROOT_MATH_ARCH::AxisAngle::Invert ( )
inline

Invert an AxisAngle rotation in place.

Definition at line 273 of file AxisAngle.h.

◆ operator!=()

bool ROOT::ROOT_MATH_ARCH::AxisAngle::operator!= ( const AxisAngle & rhs) const
inline

Definition at line 328 of file AxisAngle.h.

◆ operator()() [1/5]

template<class CoordSystem , class Tag >
DisplacementVector3D< CoordSystem, Tag > ROOT::ROOT_MATH_ARCH::AxisAngle::operator() ( const DisplacementVector3D< CoordSystem, Tag > & v) const
inline

Rotation operation on a displacement vector in any coordinate system.

Definition at line 216 of file AxisAngle.h.

◆ operator()() [2/5]

template<class ForeignVector >
ForeignVector ROOT::ROOT_MATH_ARCH::AxisAngle::operator() ( const ForeignVector & v) const
inline

Rotation operation on an arbitrary vector v.

Preconditions: v must implement methods x(), y(), and z() and the arbitrary vector type must have a constructor taking (x,y,z)

Definition at line 254 of file AxisAngle.h.

◆ operator()() [3/5]

template<class CoordSystem >
LorentzVector< CoordSystem > ROOT::ROOT_MATH_ARCH::AxisAngle::operator() ( const LorentzVector< CoordSystem > & v) const
inline

Rotation operation on a Lorentz vector in any 4D coordinate system.

Definition at line 240 of file AxisAngle.h.

◆ operator()() [4/5]

template<class CoordSystem , class Tag >
PositionVector3D< CoordSystem, Tag > ROOT::ROOT_MATH_ARCH::AxisAngle::operator() ( const PositionVector3D< CoordSystem, Tag > & p) const
inline

Rotation operation on a position vector in any coordinate system.

Definition at line 229 of file AxisAngle.h.

◆ operator()() [5/5]

DisplacementVector3D< Cartesian3D< double > > ROOT::ROOT_MATH_ARCH::AxisAngle::operator() ( const XYZVector & v) const

Definition at line 84 of file AxisAngle.cxx.

◆ operator*() [1/9]

template<class AVector >
AVector ROOT::ROOT_MATH_ARCH::AxisAngle::operator* ( const AVector & v) const
inline

Overload operator * for rotation on a vector.

Definition at line 265 of file AxisAngle.h.

◆ operator*() [2/9]

AxisAngle ROOT::ROOT_MATH_ARCH::AxisAngle::operator* ( const AxisAngle & a) const

Definition at line 43 of file AxisAngleXother.cxx.

◆ operator*() [3/9]

AxisAngle ROOT::ROOT_MATH_ARCH::AxisAngle::operator* ( const EulerAngles & e) const

Definition at line 49 of file AxisAngleXother.cxx.

◆ operator*() [4/9]

AxisAngle ROOT::ROOT_MATH_ARCH::AxisAngle::operator* ( const Quaternion & q) const

Definition at line 61 of file AxisAngleXother.cxx.

◆ operator*() [5/9]

AxisAngle ROOT::ROOT_MATH_ARCH::AxisAngle::operator* ( const Rotation3D & r) const

Multiply (combine) two rotations.

Definition at line 37 of file AxisAngleXother.cxx.

◆ operator*() [6/9]

AxisAngle ROOT::ROOT_MATH_ARCH::AxisAngle::operator* ( const RotationX & rx) const

Definition at line 101 of file AxisAngleXother.cxx.

◆ operator*() [7/9]

AxisAngle ROOT::ROOT_MATH_ARCH::AxisAngle::operator* ( const RotationY & ry) const

Definition at line 141 of file AxisAngleXother.cxx.

◆ operator*() [8/9]

AxisAngle ROOT::ROOT_MATH_ARCH::AxisAngle::operator* ( const RotationZ & rz) const

Definition at line 181 of file AxisAngleXother.cxx.

◆ operator*() [9/9]

AxisAngle ROOT::ROOT_MATH_ARCH::AxisAngle::operator* ( const RotationZYX & r) const

Definition at line 55 of file AxisAngleXother.cxx.

◆ operator*=()

template<class R >
AxisAngle & ROOT::ROOT_MATH_ARCH::AxisAngle::operator*= ( const R & r)
inline

Post-Multiply (on right) by another rotation : T = T*R.

Definition at line 303 of file AxisAngle.h.

◆ operator=()

template<class OtherRotation >
AxisAngle & ROOT::ROOT_MATH_ARCH::AxisAngle::operator= ( OtherRotation const & r)
inline

Assign from another supported rotation type (see gv_detail::convert )

Definition at line 109 of file AxisAngle.h.

◆ operator==()

bool ROOT::ROOT_MATH_ARCH::AxisAngle::operator== ( const AxisAngle & rhs) const
inline

Equality/inequality operators.

Definition at line 320 of file AxisAngle.h.

◆ Pi()

static double ROOT::ROOT_MATH_ARCH::AxisAngle::Pi ( )
inlinestaticprivate

Definition at line 336 of file AxisAngle.h.

◆ Rectify()

void ROOT::ROOT_MATH_ARCH::AxisAngle::Rectify ( )

Re-adjust components to eliminate small deviations from the axis being a unit vector and angles out of the canonical range (-pi,pi].

Definition at line 53 of file AxisAngle.cxx.

◆ RectifyAngle()

void ROOT::ROOT_MATH_ARCH::AxisAngle::RectifyAngle ( )
private

Definition at line 35 of file AxisAngle.cxx.

◆ SetComponents() [1/2]

template<class AnyVector >
void ROOT::ROOT_MATH_ARCH::AxisAngle::SetComponents ( const AnyVector & v,
Scalar angle )
inline

Set components from a non-zero vector (x,y,z) and an angle.

Precondition: the Vector needs to implement x(), y(), z(), and unit()

Definition at line 176 of file AxisAngle.h.

◆ SetComponents() [2/2]

template<class IT >
void ROOT::ROOT_MATH_ARCH::AxisAngle::SetComponents ( IT begin,
IT end )
inline

Set the axis and then the angle given a pair of pointers or iterators defining the beginning and end of an array of four Scalars.

Precondition: The first three components are assumed to represent the rotation axis vector and the 4-th the rotation angle. The angle is assumed to be in the range (-pi,pi]. The axis vector is automatically normalized to be a unit vector

Definition at line 126 of file AxisAngle.h.

Member Data Documentation

◆ fAngle

Scalar ROOT::ROOT_MATH_ARCH::AxisAngle::fAngle
private

Definition at line 332 of file AxisAngle.h.

◆ fAxis

AxisVector ROOT::ROOT_MATH_ARCH::AxisAngle::fAxis
private

Definition at line 331 of file AxisAngle.h.

  • math/experimental/genvectorx/inc/MathX/GenVectorX/AxisAngle.h
  • math/experimental/genvectorx/src/AxisAngle.cxx
  • math/experimental/genvectorx/src/AxisAngleXother.cxx