ROOT   6.08/07 Reference Guide
ROOT::Math::Transform3D Class Reference

Basic 3D Transformation class describing a rotation and then a translation The internal data are a 3D rotation data (represented as a 3x3 matrix) and a 3D vector data.

They are represented and held in this class like a 3x4 matrix (a simple array of 12 numbers).

The class can be constructed from any 3D rotation object (ROOT::Math::Rotation3D, ROOT::Math::AxisAngle, ROOT::Math::Quaternion, etc...) and/or a 3D Vector (ROOT::Math::DislacementVector3D or via ROOT::Math::Translation ) representing a Translation. The Transformation is defined by applying first the rotation and then the translation. A transformation defined by applying first a translation and then a rotation is equivalent to the transformation obtained applying first the rotation and then a translation equivalent to the rotated vector. The operator * can be used to obtain directly such transformations, in addition to combine various transformations. Keep in mind that the operator * (like in the case of rotations ) is not commutative. The operator * is used (in addition to operator() ) to apply a transformations on the vector (DisplacementVector3D and LorentzVector classes) and point (PositionVector3D) classes. In the case of Vector objects the transformation only rotates them and does not translate them. Only Point objects are able to be both rotated and translated.

Definition at line 85 of file Transform3D.h.

## Public Types

enum  ETransform3DMatrixIndex {
kXX = 0, kXY = 1, kXZ = 2, kDX = 3,
kYX = 4, kYY = 5, kYZ = 6, kDY = 7,
kZX = 8, kZY = 9, kZZ =10, kDZ = 11
}

typedef PositionVector3D< Cartesian3D< double >, DefaultCoordinateSystemTagPoint

typedef DisplacementVector3D< Cartesian3D< double >, DefaultCoordinateSystemTagVector

## Public Member Functions

Transform3D ()
Default constructor (identy rotation) + zero translation. More...

template<class IT >
Transform3D (IT begin, IT end)
Construct given a pair of pointers or iterators defining the beginning and end of an array of 12 Scalars. More...

Transform3D (const Rotation3D &r, const Vector &v)
Construct from a rotation and then a translation described by a Vector. More...

Transform3D (const Rotation3D &r, const Translation3D &t)
Construct from a rotation and then a translation described by a Translation3D class. More...

template<class ARotation , class CoordSystem , class Tag >
Transform3D (const ARotation &r, const DisplacementVector3D< CoordSystem, Tag > &v)
Construct from a rotation (any rotation object) and then a translation (represented by any DisplacementVector) The requirements on the rotation and vector objects are that they can be transformed in a Rotation3D class and in a Cartesian3D Vector. More...

template<class ARotation >
Transform3D (const ARotation &r, const Translation3D &t)
Construct from a rotation (any rotation object) and then a translation represented by a Translation3D class The requirements on the rotation is that it can be transformed in a Rotation3D class. More...

Transform3D (const Rotation3D &r)
Construct from a 3D Rotation only with zero translation. More...

Transform3D (const AxisAngle &r)

Transform3D (const EulerAngles &r)

Transform3D (const Quaternion &r)

Transform3D (const RotationZYX &r)

Transform3D (const RotationX &r)

Transform3D (const RotationY &r)

Transform3D (const RotationZ &r)

template<class CoordSystem , class Tag >
Transform3D (const DisplacementVector3D< CoordSystem, Tag > &v)
Construct from a translation only, represented by any DisplacementVector3D and with an identity rotation. More...

Transform3D (const Vector &v)
Construct from a translation only, represented by a Cartesian 3D Vector, and with an identity rotation. More...

Transform3D (const Translation3D &t)
Construct from a translation only, represented by a Translation3D class and with an identity rotation. More...

Transform3D (const Point &fr0, const Point &fr1, const Point &fr2, const Point &to0, const Point &to1, const Point &to2)
Construct transformation from one coordinate system defined by three points (origin + two axis) to a new coordinate system defined by other three points (origin + axis) More...

template<class ForeignMatrix >
Transform3D (const ForeignMatrix &m)
Construct from a linear algebra matrix of size at least 3x4, which must support operator()(i,j) to obtain elements (0,0) thru (2,3). More...

Transform3D (double xx, double xy, double xz, double dx, double yx, double yy, double yz, double dy, double zx, double zy, double zz, double dz)
Raw constructor from 12 Scalar components. More...

template<class IT >
void GetComponents (IT begin, IT end) const
Get the 12 matrix components into data specified by an iterator begin and another to the end of the desired data (12 past start). More...

template<class IT >
void GetComponents (IT begin) const
Get the 12 matrix components into data specified by an iterator begin. More...

void GetComponents (double &xx, double &xy, double &xz, double &dx, double &yx, double &yy, double &yz, double &dy, double &zx, double &zy, double &zz, double &dz) const
Get the components into 12 scalars. More...

template<class AnyRotation , class V >
void GetDecomposition (AnyRotation &r, V &v) const
Get the rotation and translation vector representing the 3D transformation in any rotation and any vector (the Translation class could also be used) More...

void GetDecomposition (Rotation3D &r, Vector &v) const
Get the rotation and translation vector representing the 3D transformation. More...

template<class AnyRotation >
void GetRotation (AnyRotation &r) const
Get the rotation (any type) representing the 3D transformation. More...

template<class ForeignMatrix >
void GetTransformMatrix (ForeignMatrix &m) const
Get components into a linear algebra matrix of size at least 3x4, which must support operator()(i,j) for write access to elements (0,0) thru (2,3). More...

template<class AnyVector >
void GetTranslation (AnyVector &v) const
Get the translation representing the 3D transformation in any vector which implements the SetXYZ method. More...

Transform3D Inverse () const
Return the inverse of the transformation. More...

void Invert ()
Invert the transformation in place. More...

bool operator!= (const Transform3D &rhs) const
Inequality operator. More...

Point operator() (const Point &p) const
Transformation operation for Position Vector in Cartesian coordinate For a Position Vector first a rotation and then a translation is applied. More...

Vector operator() (const Vector &v) const
Transformation operation for Displacement Vectors in Cartesian coordinate For the Displacement Vectors only the rotation applies - no translations. More...

template<class CoordSystem >
PositionVector3D< CoordSystem > operator() (const PositionVector3D< CoordSystem > &p) const
Transformation operation for Position Vector in any coordinate system. More...

template<class CoordSystem >
DisplacementVector3D< CoordSystem > operator() (const DisplacementVector3D< CoordSystem > &v) const
Transformation operation for Displacement Vector in any coordinate system. More...

template<class CoordSystem >
LorentzVector< CoordSystem > operator() (const LorentzVector< CoordSystem > &q) const
Transformation operation for a Lorentz Vector in any coordinate system. More...

Plane3D operator() (const Plane3D &plane) const
Transformation on a 3D plane. More...

template<class AVector >
AVector operator* (const AVector &v) const
Transformation operation for Vectors. More...

Transform3D operator* (const Transform3D &t) const
multiply (combine) two transformations More...

Transform3Doperator*= (const Transform3D &t)
multiply (combine) with another transformation in place More...

template<class ForeignMatrix >
Transform3Doperator= (const ForeignMatrix &m)
Construct from a linear algebra matrix of size at least 3x4, which must support operator()(i,j) to obtain elements (0,0) thru (2,3). More...

bool operator== (const Transform3D &rhs) const
Equality operator. More...

Rotation3D Rotation () const
Get the 3D rotation representing the 3D transformation. More...

template<class AnyRotation >
AnyRotation Rotation () const
Get the rotation representing the 3D transformation. More...

template<class IT >
void SetComponents (IT begin, IT end)
Set the 12 matrix components given an iterator to the start of the desired data, and another to the end (12 past start). More...

void SetComponents (double xx, double xy, double xz, double dx, double yx, double yy, double yz, double dy, double zx, double zy, double zz, double dz)
Set the components from 12 scalars. More...

template<class ForeignMatrix >
void SetTransformMatrix (const ForeignMatrix &m)
Set components from a linear algebra matrix of size at least 3x4, which must support operator()(i,j) to obtain elements (0,0) thru (2,3). More...

template<class CoordSystem , class Tag1 , class Tag2 >
void Transform (const PositionVector3D< CoordSystem, Tag1 > &p1, PositionVector3D< CoordSystem, Tag2 > &p2) const
Transformation operation for points between different coordinate system tags. More...

template<class CoordSystem , class Tag1 , class Tag2 >
void Transform (const DisplacementVector3D< CoordSystem, Tag1 > &v1, DisplacementVector3D< CoordSystem, Tag2 > &v2) const
Transformation operation for Displacement Vector of different coordinate systems. More...

Translation3D Translation () const
Get the translation representing the 3D transformation in a Cartesian vector. More...

## Protected Member Functions

void AssignFrom (const Rotation3D &r, const Vector &v)
make transformation from first a rotation then a translation More...

void AssignFrom (const Rotation3D &r)
make transformation from only rotations (zero translation) More...

void AssignFrom (const Vector &v)
make transformation from only translation (identity rotations) More...

void SetIdentity ()
Set identity transformation (identity rotation , zero translation) More...

## Private Attributes

double fM [12]

#include <Math/GenVector/Transform3D.h>

## ◆ Point

 typedef PositionVector3D, DefaultCoordinateSystemTag > ROOT::Math::Transform3D::Point

Definition at line 91 of file Transform3D.h.

## ◆ Vector

 typedef DisplacementVector3D, DefaultCoordinateSystemTag > ROOT::Math::Transform3D::Vector

Definition at line 90 of file Transform3D.h.

## ◆ ETransform3DMatrixIndex

Enumerator
kXX
kXY
kXZ
kDX
kYX
kYY
kYZ
kDY
kZX
kZY
kZZ
kDZ

Definition at line 94 of file Transform3D.h.

## ◆ Transform3D() [1/20]

 ROOT::Math::Transform3D::Transform3D ( )
inline

Default constructor (identy rotation) + zero translation.

Definition at line 105 of file Transform3D.h.

## ◆ Transform3D() [2/20]

template<class IT >
 ROOT::Math::Transform3D::Transform3D ( IT begin, IT end )
inline

Construct given a pair of pointers or iterators defining the beginning and end of an array of 12 Scalars.

Definition at line 115 of file Transform3D.h.

## ◆ Transform3D() [3/20]

 ROOT::Math::Transform3D::Transform3D ( const Rotation3D & r, const Vector & v )
inline

Construct from a rotation and then a translation described by a Vector.

Definition at line 123 of file Transform3D.h.

## ◆ Transform3D() [4/20]

 ROOT::Math::Transform3D::Transform3D ( const Rotation3D & r, const Translation3D & t )
inline

Construct from a rotation and then a translation described by a Translation3D class.

Definition at line 130 of file Transform3D.h.

## ◆ Transform3D() [5/20]

template<class ARotation , class CoordSystem , class Tag >
 ROOT::Math::Transform3D::Transform3D ( const ARotation & r, const DisplacementVector3D< CoordSystem, Tag > & v )
inline

Construct from a rotation (any rotation object) and then a translation (represented by any DisplacementVector) The requirements on the rotation and vector objects are that they can be transformed in a Rotation3D class and in a Cartesian3D Vector.

Definition at line 142 of file Transform3D.h.

## ◆ Transform3D() [6/20]

template<class ARotation >
 ROOT::Math::Transform3D::Transform3D ( const ARotation & r, const Translation3D & t )
inline

Construct from a rotation (any rotation object) and then a translation represented by a Translation3D class The requirements on the rotation is that it can be transformed in a Rotation3D class.

Definition at line 154 of file Transform3D.h.

## ◆ Transform3D() [7/20]

 ROOT::Math::Transform3D::Transform3D ( const Rotation3D & r )
inlineexplicit

Construct from a 3D Rotation only with zero translation.

Definition at line 174 of file Transform3D.h.

## ◆ Transform3D() [8/20]

 ROOT::Math::Transform3D::Transform3D ( const AxisAngle & r )
inlineexplicit

Definition at line 181 of file Transform3D.h.

## ◆ Transform3D() [9/20]

 ROOT::Math::Transform3D::Transform3D ( const EulerAngles & r )
inlineexplicit

Definition at line 184 of file Transform3D.h.

## ◆ Transform3D() [10/20]

 ROOT::Math::Transform3D::Transform3D ( const Quaternion & r )
inlineexplicit

Definition at line 187 of file Transform3D.h.

## ◆ Transform3D() [11/20]

 ROOT::Math::Transform3D::Transform3D ( const RotationZYX & r )
inlineexplicit

Definition at line 190 of file Transform3D.h.

## ◆ Transform3D() [12/20]

 ROOT::Math::Transform3D::Transform3D ( const RotationX & r )
inlineexplicit

Definition at line 196 of file Transform3D.h.

## ◆ Transform3D() [13/20]

 ROOT::Math::Transform3D::Transform3D ( const RotationY & r )
inlineexplicit

Definition at line 199 of file Transform3D.h.

## ◆ Transform3D() [14/20]

 ROOT::Math::Transform3D::Transform3D ( const RotationZ & r )
inlineexplicit

Definition at line 202 of file Transform3D.h.

## ◆ Transform3D() [15/20]

template<class CoordSystem , class Tag >
 ROOT::Math::Transform3D::Transform3D ( const DisplacementVector3D< CoordSystem, Tag > & v )
inlineexplicit

Construct from a translation only, represented by any DisplacementVector3D and with an identity rotation.

Definition at line 211 of file Transform3D.h.

## ◆ Transform3D() [16/20]

 ROOT::Math::Transform3D::Transform3D ( const Vector & v )
inlineexplicit

Construct from a translation only, represented by a Cartesian 3D Vector, and with an identity rotation.

Definition at line 218 of file Transform3D.h.

## ◆ Transform3D() [17/20]

 ROOT::Math::Transform3D::Transform3D ( const Translation3D & t )
inlineexplicit

Construct from a translation only, represented by a Translation3D class and with an identity rotation.

Definition at line 225 of file Transform3D.h.

## ◆ Transform3D() [18/20]

 ROOT::Math::Transform3D::Transform3D ( const Point & fr0, const Point & fr1, const Point & fr2, const Point & to0, const Point & to1, const Point & to2 )

Construct transformation from one coordinate system defined by three points (origin + two axis) to a new coordinate system defined by other three points (origin + axis)

Parameters
 fr0 point defining origin of original reference system fr1 point defining first axis of original reference system fr2 point defining second axis of original reference system to0 point defining origin of transformed reference system to1 point defining first axis transformed reference system to2 point defining second axis transformed reference system

Definition at line 41 of file Transform3D.cxx.

## ◆ Transform3D() [19/20]

template<class ForeignMatrix >
 ROOT::Math::Transform3D::Transform3D ( const ForeignMatrix & m )
inlineexplicit

Construct from a linear algebra matrix of size at least 3x4, which must support operator()(i,j) to obtain elements (0,0) thru (2,3).

The 3x3 sub-block is assumed to be the rotation part and the translations vector are described by the 4-th column

Definition at line 277 of file Transform3D.h.

## ◆ Transform3D() [20/20]

 ROOT::Math::Transform3D::Transform3D ( double xx, double xy, double xz, double dx, double yx, double yy, double yz, double dy, double zx, double zy, double zz, double dz )
inline

Raw constructor from 12 Scalar components.

Definition at line 284 of file Transform3D.h.

## ◆ AssignFrom() [1/3]

 void ROOT::Math::Transform3D::AssignFrom ( const Rotation3D & r, const Vector & v )
protected

make transformation from first a rotation then a translation

Definition at line 157 of file Transform3D.cxx.

## ◆ AssignFrom() [2/3]

 void ROOT::Math::Transform3D::AssignFrom ( const Rotation3D & r )
protected

make transformation from only rotations (zero translation)

Definition at line 182 of file Transform3D.cxx.

## ◆ AssignFrom() [3/3]

 void ROOT::Math::Transform3D::AssignFrom ( const Vector & v )
protected

make transformation from only translation (identity rotations)

Definition at line 195 of file Transform3D.cxx.

## ◆ GetComponents() [1/3]

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

Get the 12 matrix components into data specified by an iterator begin and another to the end of the desired data (12 past start).

Definition at line 331 of file Transform3D.h.

## ◆ GetComponents() [2/3]

template<class IT >
 void ROOT::Math::Transform3D::GetComponents ( IT begin ) const
inline

Get the 12 matrix components into data specified by an iterator begin.

Definition at line 346 of file Transform3D.h.

## ◆ GetComponents() [3/3]

 void ROOT::Math::Transform3D::GetComponents ( double & xx, double & xy, double & xz, double & dx, double & yx, double & yy, double & yz, double & dy, double & zx, double & zy, double & zz, double & dz ) const
inline

Get the components into 12 scalars.

Definition at line 394 of file Transform3D.h.

## ◆ GetDecomposition() [1/2]

template<class AnyRotation , class V >
 void ROOT::Math::Transform3D::GetDecomposition ( AnyRotation & r, V & v ) const
inline

Get the rotation and translation vector representing the 3D transformation in any rotation and any vector (the Translation class could also be used)

Definition at line 408 of file Transform3D.h.

## ◆ GetDecomposition() [2/2]

 void ROOT::Math::Transform3D::GetDecomposition ( Rotation3D & r, Vector & v ) const
inline

Get the rotation and translation vector representing the 3D transformation.

Definition at line 417 of file Transform3D.h.

## ◆ GetRotation()

template<class AnyRotation >
 void ROOT::Math::Transform3D::GetRotation ( AnyRotation & r ) const
inline

Get the rotation (any type) representing the 3D transformation.

Definition at line 445 of file Transform3D.h.

## ◆ GetTransformMatrix()

template<class ForeignMatrix >
 void ROOT::Math::Transform3D::GetTransformMatrix ( ForeignMatrix & m ) const
inline

Get components into a linear algebra matrix of size at least 3x4, which must support operator()(i,j) for write access to elements (0,0) thru (2,3).

Definition at line 371 of file Transform3D.h.

## ◆ GetTranslation()

template<class AnyVector >
 void ROOT::Math::Transform3D::GetTranslation ( AnyVector & v ) const
inline

Get the translation representing the 3D transformation in any vector which implements the SetXYZ method.

Definition at line 461 of file Transform3D.h.

## ◆ Inverse()

 Transform3D ROOT::Math::Transform3D::Inverse ( ) const
inline

Return the inverse of the transformation.

Definition at line 576 of file Transform3D.h.

## ◆ Invert()

 void ROOT::Math::Transform3D::Invert ( )

Invert the transformation in place.

Definition at line 116 of file Transform3D.cxx.

## ◆ operator!=()

 bool ROOT::Math::Transform3D::operator!= ( const Transform3D & rhs ) const
inline

Inequality operator.

Check equality for each element To do: use double tolerance

Definition at line 607 of file Transform3D.h.

## ◆ operator()() [1/6]

 Point ROOT::Math::Transform3D::operator() ( const Point & p ) const
inline

Transformation operation for Position Vector in Cartesian coordinate For a Position Vector first a rotation and then a translation is applied.

Definition at line 473 of file Transform3D.h.

## ◆ operator()() [2/6]

 Vector ROOT::Math::Transform3D::operator() ( const Vector & v ) const
inline

Transformation operation for Displacement Vectors in Cartesian coordinate For the Displacement Vectors only the rotation applies - no translations.

Definition at line 484 of file Transform3D.h.

## ◆ operator()() [3/6]

template<class CoordSystem >
 PositionVector3D ROOT::Math::Transform3D::operator() ( const PositionVector3D< CoordSystem > & p ) const
inline

Transformation operation for Position Vector in any coordinate system.

Definition at line 495 of file Transform3D.h.

## ◆ operator()() [4/6]

template<class CoordSystem >
 DisplacementVector3D ROOT::Math::Transform3D::operator() ( const DisplacementVector3D< CoordSystem > & v ) const
inline

Transformation operation for Displacement Vector in any coordinate system.

Definition at line 504 of file Transform3D.h.

## ◆ operator()() [5/6]

template<class CoordSystem >
 LorentzVector ROOT::Math::Transform3D::operator() ( const LorentzVector< CoordSystem > & q ) const
inline

Transformation operation for a Lorentz Vector in any coordinate system.

Definition at line 532 of file Transform3D.h.

## ◆ operator()() [6/6]

 Plane3D ROOT::Math::Transform3D::operator() ( const Plane3D & plane ) const

Transformation on a 3D plane.

Definition at line 203 of file Transform3D.cxx.

## ◆ operator*() [1/2]

template<class AVector >
 AVector ROOT::Math::Transform3D::operator* ( const AVector & v ) const
inline

Transformation operation for Vectors.

Apply same rules as operator() depending on type of vector. Will work only for DisplacementVector3D, PositionVector3D and LorentzVector

Definition at line 552 of file Transform3D.h.

## ◆ operator*() [2/2]

 Transform3D ROOT::Math::Transform3D::operator* ( const Transform3D & t ) const
inline

multiply (combine) two transformations

Definition at line 670 of file Transform3D.h.

## ◆ operator*=()

 Transform3D & ROOT::Math::Transform3D::operator*= ( const Transform3D & t )
inline

multiply (combine) with another transformation in place

Definition at line 646 of file Transform3D.h.

## ◆ operator=()

template<class ForeignMatrix >
 Transform3D& ROOT::Math::Transform3D::operator= ( const ForeignMatrix & m )
inline

Construct from a linear algebra matrix of size at least 3x4, which must support operator()(i,j) to obtain elements (0,0) thru (2,3).

The 3x3 sub-block is assumed to be the rotation part and the translations vector are described by the 4-th column

Definition at line 299 of file Transform3D.h.

## ◆ operator==()

 bool ROOT::Math::Transform3D::operator== ( const Transform3D & rhs ) const
inline

Equality operator.

Check equality for each element To do: use double tolerance

Definition at line 587 of file Transform3D.h.

## ◆ Rotation() [1/2]

 Rotation3D ROOT::Math::Transform3D::Rotation ( ) const
inline

Get the 3D rotation representing the 3D transformation.

Definition at line 425 of file Transform3D.h.

## ◆ Rotation() [2/2]

template<class AnyRotation >
 AnyRotation ROOT::Math::Transform3D::Rotation ( ) const
inline

Get the rotation representing the 3D transformation.

Definition at line 435 of file Transform3D.h.

## ◆ SetComponents() [1/2]

template<class IT >
 void ROOT::Math::Transform3D::SetComponents ( IT begin, IT end )
inline

Set the 12 matrix components given an iterator to the start of the desired data, and another to the end (12 past start).

Definition at line 314 of file Transform3D.h.

## ◆ SetComponents() [2/2]

 void ROOT::Math::Transform3D::SetComponents ( double xx, double xy, double xz, double dx, double yx, double yy, double yz, double dy, double zx, double zy, double zz, double dz )
inline

Set the components from 12 scalars.

Definition at line 382 of file Transform3D.h.

## ◆ SetIdentity()

 void ROOT::Math::Transform3D::SetIdentity ( )
protected

Set identity transformation (identity rotation , zero translation)

Definition at line 148 of file Transform3D.cxx.

## ◆ SetTransformMatrix()

template<class ForeignMatrix >
 void ROOT::Math::Transform3D::SetTransformMatrix ( const ForeignMatrix & m )
inline

Set components from a linear algebra matrix of size at least 3x4, which must support operator()(i,j) to obtain elements (0,0) thru (2,3).

The 3x3 sub-block is assumed to be the rotation part and the translations vector are described by the 4-th column

Definition at line 358 of file Transform3D.h.

## ◆ Transform() [1/2]

template<class CoordSystem , class Tag1 , class Tag2 >
 void ROOT::Math::Transform3D::Transform ( const PositionVector3D< CoordSystem, Tag1 > & p1, PositionVector3D< CoordSystem, Tag2 > & p2 ) const
inline

Transformation operation for points between different coordinate system tags.

Definition at line 513 of file Transform3D.h.

## ◆ Transform() [2/2]

template<class CoordSystem , class Tag1 , class Tag2 >
 void ROOT::Math::Transform3D::Transform ( const DisplacementVector3D< CoordSystem, Tag1 > & v1, DisplacementVector3D< CoordSystem, Tag2 > & v2 ) const
inline

Transformation operation for Displacement Vector of different coordinate systems.

Definition at line 523 of file Transform3D.h.

## ◆ Translation()

 Translation3D ROOT::Math::Transform3D::Translation ( ) const
inline

Get the translation representing the 3D transformation in a Cartesian vector.

Definition at line 452 of file Transform3D.h.

## ◆ fM

 double ROOT::Math::Transform3D::fM[12]
private

Definition at line 637 of file Transform3D.h.

The documentation for this class was generated from the following files: