Geant4 11.4.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
HepGeom::Rotate3D Class Reference

#include <Transform3D.h>

Inheritance diagram for HepGeom::Rotate3D:

Public Member Functions

 Rotate3D ()
 Rotate3D (const CLHEP::HepRotation &mt)
 Rotate3D (double a, const Point3D< double > &p1, const Point3D< double > &p2)
 Rotate3D (double a, const Vector3D< double > &v)
 Rotate3D (const Point3D< double > &fr1, const Point3D< double > &fr2, const Point3D< double > &to1, const Point3D< double > &to2)
Public Member Functions inherited from HepGeom::Transform3D
 Transform3D ()
 Transform3D (const CLHEP::HepRotation &mt, const CLHEP::Hep3Vector &v)
 Transform3D (const Point3D< double > &fr0, const Point3D< double > &fr1, const Point3D< double > &fr2, const Point3D< double > &to0, const Point3D< double > &to1, const Point3D< double > &to2)
 Transform3D (const Transform3D &mt)=default
 Transform3D (Transform3D &&mt)=default
 ~Transform3D ()=default
Transform3Doperator= (const Transform3D &mt)=default
Transform3Doperator= (Transform3D &&mt)=default
const Transform3D_row operator[] (int) const
double operator() (int, int) const
double xx () const
double xy () const
double xz () const
double yx () const
double yy () const
double yz () const
double zx () const
double zy () const
double zz () const
double dx () const
double dy () const
double dz () const
void setIdentity ()
Transform3D inverse () const
Transform3D operator* (const Transform3D &b) const
void getDecomposition (Scale3D &scale, Rotate3D &rotation, Translate3D &translation) const
bool isNear (const Transform3D &t, double tolerance=2.2E-14) const
CLHEP::HepRotation getRotation () const
CLHEP::Hep3Vector getTranslation () const
bool operator== (const Transform3D &transform) const
bool operator!= (const Transform3D &transform) const

Additional Inherited Members

Static Public Attributes inherited from HepGeom::Transform3D
static DLL_API const Transform3D Identity = Transform3D ()
Protected Member Functions inherited from HepGeom::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)
void setTransform (double XX, double XY, double XZ, double DX, double YX, double YY, double YZ, double DY, double ZX, double ZY, double ZZ, double DZ)
Protected Attributes inherited from HepGeom::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_

Detailed Description

Constructs a rotation transformation. This class provides additional constructors for Transform3D and should not be used as a separate class.

Example of use:

m = Rotate3D(30.*deg, HepVector3D(1.,1.,1.));
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)
Author
Evgue.nosp@m.ni.T.nosp@m.chern.nosp@m.iaev.nosp@m.@cern.nosp@m..ch

Definition at line 370 of file Transform3D.h.

Constructor & Destructor Documentation

◆ Rotate3D() [1/5]

HepGeom::Rotate3D::Rotate3D ( )
inline

Default constructor: sets the Identity transformation.

Definition at line 374 of file Transform3D.h.

Referenced by HepGeom::RotateX3D::RotateX3D(), HepGeom::RotateY3D::RotateY3D(), and HepGeom::RotateZ3D::RotateZ3D().

◆ Rotate3D() [2/5]

HepGeom::Rotate3D::Rotate3D ( const CLHEP::HepRotation & mt)
inline

Constructor from CLHEP::HepRotation.

◆ Rotate3D() [3/5]

HepGeom::Rotate3D::Rotate3D ( double a,
const Point3D< double > & p1,
const Point3D< double > & p2 )

Constructor from angle and axis given by two points.

Parameters
aangle of rotation
p1begin point of the axis
p2end point of the axis

Definition at line 230 of file Transform3D.cc.

232 : Transform3D()
233 /***********************************************************************
234 * *
235 * Name: Rotate3D::Rotate3D Date: 24.09.96 *
236 * Author: E.Chernyaev (IHEP/Protvino) Revised: *
237 * *
238 * Function: Create 3D Rotation through angle "a" (counterclockwise) *
239 * around the axis p1->p2 *
240 * *
241 ***********************************************************************/
242 {
243 if (a == 0) return;
244
245 double cx = p2.x()-p1.x(), cy = p2.y()-p1.y(), cz = p2.z()-p1.z();
246 double ll = std::sqrt(cx*cx + cy*cy + cz*cz);
247 if (ll == 0) {
248 std::cerr << "Rotate3D: zero axis" << std::endl;
249 }else{
250 double cosa = std::cos(a), sina = std::sin(a);
251 cx /= ll; cy /= ll; cz /= ll;
252
253 double txx = cosa + (1-cosa)*cx*cx;
254 double txy = (1-cosa)*cx*cy - sina*cz;
255 double txz = (1-cosa)*cx*cz + sina*cy;
256
257 double tyx = (1-cosa)*cy*cx + sina*cz;
258 double tyy = cosa + (1-cosa)*cy*cy;
259 double tyz = (1-cosa)*cy*cz - sina*cx;
260
261 double tzx = (1-cosa)*cz*cx - sina*cy;
262 double tzy = (1-cosa)*cz*cy + sina*cx;
263 double tzz = cosa + (1-cosa)*cz*cz;
264
265 double tdx = p1.x(), tdy = p1.y(), tdz = p1.z();
266
267 setTransform(txx, txy, txz, tdx-txx*tdx-txy*tdy-txz*tdz,
268 tyx, tyy, tyz, tdy-tyx*tdx-tyy*tdy-tyz*tdz,
269 tzx, tzy, tzz, tdz-tzx*tdx-tzy*tdy-tzz*tdz);
270 }
271 }
void setTransform(double XX, double XY, double XZ, double DX, double YX, double YY, double YZ, double DY, double ZX, double ZY, double ZZ, double DZ)

◆ Rotate3D() [4/5]

HepGeom::Rotate3D::Rotate3D ( double a,
const Vector3D< double > & v )
inline

Constructor from angle and axis.

Parameters
aangle of rotation
vaxis of rotation

◆ Rotate3D() [5/5]

HepGeom::Rotate3D::Rotate3D ( const Point3D< double > & fr1,
const Point3D< double > & fr2,
const Point3D< double > & to1,
const Point3D< double > & to2 )
inline

Constructor for rotation given by original and rotated position of two points. It is assumed that there is no reflection.

Parameters
fr1original position of 1st point
fr2original position of 2nd point
to1rotated position of 1st point
to2rotated position of 2nd point

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