Jpp master_rocky-44-g75b7c4f75
the software that should make you happy
Loading...
Searching...
No Matches
JGEOMETRY3D::JRotation3Z Class Reference

Rotation around Z-axis. More...

#include <JRotation3D.hh>

Inheritance diagram for JGEOMETRY3D::JRotation3Z:
JGEOMETRY2D::JRotation2D JMATH::JMatrix2D JMATH::JMath< JMatrix2D > JLANG::JEquals< JFirst_t, JSecond_t >

Public Member Functions

 JRotation3Z ()
 Default constructor (= identity matrix).
 
 JRotation3Z (const double phi)
 Constructor.
 
const JRotation2D & getRotation () const
 Get rotation.
 
JRotation2D & transpose ()
 Transpose.
 
JRotation2D & mul (const JRotation2D &A)
 Matrix multiplication.
 
JMatrix2D & mul (const double factor)
 Scale matrix.
 
JMatrix2D & mul (const JMatrix2D &A, const JMatrix2D &B)
 Matrix multiplication.
 
JMatrix2D & mul (const JSecond_t &object)
 Multiply with object.
 
void rotate (double &__x, double &__y) const
 Rotate.
 
void rotate_back (double &__x, double &__y) const
 Rotate back.
 
JMatrix2D & setIdentity ()
 Set to identity matrix.
 
void set (const JMatrix2D &A)
 Set matrix.
 
JMatrix2D & reset ()
 Set matrix to the null matrix.
 
JMatrix2D & negate ()
 Negate matrix.
 
JMatrix2D & add (const JMatrix2D &A)
 Matrix addition.
 
JMatrix2D & sub (const JMatrix2D &A)
 Matrix subtraction.
 
JMatrix2D & div (const double factor)
 Scale matrix.
 
bool equals (const JMatrix2D &A, const double eps=std::numeric_limits< double >::min()) const
 Equality.
 
bool isIdentity (const double eps=std::numeric_limits< double >::min()) const
 Test identity.
 
double getDeterminant () const
 Get determinant of matrix.
 
void transform (double &__x, double &__y) const
 Transform.
 

Static Public Member Functions

static const JMatrix2D & getInstance ()
 Get reference to unique instance of this class object.
 
static const JMatrix2D & getIdentity ()
 Get reference to unique instance of this class object.
 

Public Attributes

double a00
 
double a01
 
double a10
 
double a11
 

Detailed Description

Rotation around Z-axis.

Definition at line 85 of file JRotation3D.hh.

Constructor & Destructor Documentation

◆ JRotation3Z() [1/2]

JGEOMETRY3D::JRotation3Z::JRotation3Z ( )
inline

Default constructor (= identity matrix).

Definition at line 92 of file JRotation3D.hh.

92 :
94 {}
JRotation2D()
Default constructor (= identity matrix).

◆ JRotation3Z() [2/2]

JGEOMETRY3D::JRotation3Z::JRotation3Z ( const double phi)
inline

Constructor.

Parameters
phirotation angle (anti-clock wise) [rad]

Definition at line 102 of file JRotation3D.hh.

102 :
103 JRotation2D(phi)
104 {}

Member Function Documentation

◆ getRotation()

const JRotation2D & JGEOMETRY2D::JRotation2D::getRotation ( ) const
inlineinherited

Get rotation.

Returns
rotation

Definition at line 59 of file JRotation2D.hh.

60 {
61 return static_cast<const JRotation2D&>(*this);
62 }

◆ transpose()

JRotation2D & JGEOMETRY2D::JRotation2D::transpose ( )
inlineinherited

Transpose.

Definition at line 68 of file JRotation2D.hh.

69 {
71
72 return *this;
73 }
JMatrix2D & transpose()
Transpose.

◆ mul() [1/4]

JRotation2D & JGEOMETRY2D::JRotation2D::mul ( const JRotation2D & A)
inlineinherited

Matrix multiplication.

Parameters
Amatrix
Returns
this * A

Definition at line 82 of file JRotation2D.hh.

83 {
85
86 return *this;
87 }
JMatrix2D & mul(const double factor)
Scale matrix.

◆ mul() [2/4]

JMatrix2D & JMATH::JMatrix2D::mul ( const double factor)
inlineinherited

Scale matrix.

Parameters
factorfactor
Returns
this matrix * factor

Definition at line 194 of file JMath/JMatrix2D.hh.

195 {
196 a00 *= factor; a01 *= factor;
197 a10 *= factor; a11 *= factor;
198
199 return *this;
200 }

◆ mul() [3/4]

JMatrix2D & JMATH::JMatrix2D::mul ( const JMatrix2D & A,
const JMatrix2D & B )
inlineinherited

Matrix multiplication.

Parameters
Amatrix
Bmatrix
Returns
this matrix

Definition at line 225 of file JMath/JMatrix2D.hh.

227 {
228 a00 = A.a00 * B.a00 + A.a01 * B.a10;
229 a01 = A.a00 * B.a01 + A.a01 * B.a11;
230
231 a10 = A.a10 * B.a00 + A.a11 * B.a10;
232 a11 = A.a10 * B.a01 + A.a11 * B.a11;
233
234 return *this;
235 }

◆ mul() [4/4]

JMatrix2D & JMATH::JMath< JMatrix2D, JSecond_t >::mul ( const JSecond_t & object)
inlineinherited

Multiply with object.

Parameters
objectobject
Returns
result object

Definition at line 354 of file JMath.hh.

355 {
356 return static_cast<JFirst_t&>(*this) = JFirst_t().mul(static_cast<const JFirst_t&>(*this), object);
357 }

◆ rotate()

void JGEOMETRY2D::JRotation2D::rotate ( double & __x,
double & __y ) const
inlineinherited

Rotate.

Parameters
__xx value
__yy value

Definition at line 96 of file JRotation2D.hh.

97 {
98 const double x = a00 * __x + a01 * __y;
99 const double y = a10 * __x + a11 * __y;
100
101 __x = x;
102 __y = y;
103 }

◆ rotate_back()

void JGEOMETRY2D::JRotation2D::rotate_back ( double & __x,
double & __y ) const
inlineinherited

Rotate back.

Parameters
__xx value
__yy value

Definition at line 112 of file JRotation2D.hh.

113 {
114 const double x = a00 * __x + a10 * __y;
115 const double y = a01 * __x + a11 * __y;
116
117 __x = x;
118 __y = y;
119 }

◆ getInstance()

static const JMatrix2D & JMATH::JMatrix2D::getInstance ( )
inlinestaticinherited

Get reference to unique instance of this class object.

Returns
zero matrix

Definition at line 70 of file JMath/JMatrix2D.hh.

71 {
72 static JMatrix2D matrix;
73
74 return matrix;
75 }
JMatrix2D()
Default constructor.

◆ setIdentity()

JMatrix2D & JMATH::JMatrix2D::setIdentity ( )
inlineinherited

Set to identity matrix.

Returns
this matrix

Definition at line 83 of file JMath/JMatrix2D.hh.

84 {
85 a00 = 1.0; a01 = 0.0;
86 a10 = 0.0; a11 = 1.0;
87
88 return *this;
89 }

◆ getIdentity()

static const JMatrix2D & JMATH::JMatrix2D::getIdentity ( )
inlinestaticinherited

Get reference to unique instance of this class object.

Returns
identity matrix

Definition at line 97 of file JMath/JMatrix2D.hh.

98 {
99 static JMatrix2D matrix(JMatrix2D().setIdentity());
100
101 return matrix;
102 }
JMatrix2D & setIdentity()
Set to identity matrix.

◆ set()

void JMATH::JMatrix2D::set ( const JMatrix2D & A)
inlineinherited

Set matrix.

Parameters
Amatrix

Definition at line 110 of file JMath/JMatrix2D.hh.

111 {
112 static_cast<JMatrix2D&>(*this) = A;
113 }

◆ reset()

JMatrix2D & JMATH::JMatrix2D::reset ( )
inlineinherited

Set matrix to the null matrix.

Returns
this matrix

Definition at line 121 of file JMath/JMatrix2D.hh.

122 {
123 *this = JMatrix2D();
124
125 return *this;
126 }

◆ negate()

JMatrix2D & JMATH::JMatrix2D::negate ( )
inlineinherited

Negate matrix.

Returns
-this matrix

Definition at line 149 of file JMath/JMatrix2D.hh.

150 {
151 a00 = -a00; a01 = -a01;
152 a10 = -a10; a11 = -a11;
153
154 return *this;
155 }

◆ add()

JMatrix2D & JMATH::JMatrix2D::add ( const JMatrix2D & A)
inlineinherited

Matrix addition.

Parameters
Amatrix
Returns
this matrix + A

Definition at line 164 of file JMath/JMatrix2D.hh.

165 {
166 a00 += A.a00; a01 += A.a01;
167 a10 += A.a10; a11 += A.a11;
168
169 return *this;
170 }

◆ sub()

JMatrix2D & JMATH::JMatrix2D::sub ( const JMatrix2D & A)
inlineinherited

Matrix subtraction.

Parameters
Amatrix
Returns
this matrix - A

Definition at line 179 of file JMath/JMatrix2D.hh.

180 {
181 a00 -= A.a00; a01 -= A.a01;
182 a10 -= A.a10; a11 -= A.a11;
183
184 return *this;
185 }

◆ div()

JMatrix2D & JMATH::JMatrix2D::div ( const double factor)
inlineinherited

Scale matrix.

Parameters
factorfactor
Returns
this matrix / factor

Definition at line 209 of file JMath/JMatrix2D.hh.

210 {
211 a00 /= factor; a01 /= factor;
212 a10 /= factor; a11 /= factor;
213
214 return *this;
215 }

◆ equals()

bool JMATH::JMatrix2D::equals ( const JMatrix2D & A,
const double eps = std::numeric_limits<double>::min() ) const
inlineinherited

Equality.

Parameters
Amatrix
epsnumerical precision
Returns
true if matrices identical; else false

Definition at line 245 of file JMath/JMatrix2D.hh.

247 {
248 return (fabs(a00 - A.a00) <= eps &&
249 fabs(a01 - A.a01) <= eps &&
250 fabs(a10 - A.a10) <= eps &&
251 fabs(a11 - A.a11) <= eps);
252 }

◆ isIdentity()

bool JMATH::JMatrix2D::isIdentity ( const double eps = std::numeric_limits<double>::min()) const
inlineinherited

Test identity.

Parameters
epsnumerical precision
Returns
true if identity matrix; else false

Definition at line 261 of file JMath/JMatrix2D.hh.

262 {
263 return equals(getIdentity(), eps);
264 }
static const JMatrix2D & getIdentity()
Get reference to unique instance of this class object.
bool equals(const JMatrix2D &A, const double eps=std::numeric_limits< double >::min()) const
Equality.

◆ getDeterminant()

double JMATH::JMatrix2D::getDeterminant ( ) const
inlineinherited

Get determinant of matrix.

Returns
determinant of matrix

Definition at line 272 of file JMath/JMatrix2D.hh.

273 {
274 return a00 * a11 - a01 * a10;
275 }

◆ transform()

void JMATH::JMatrix2D::transform ( double & __x,
double & __y ) const
inlineinherited

Transform.

Parameters
__xx value
__yy value

Definition at line 284 of file JMath/JMatrix2D.hh.

285 {
286 const double x = a00 * __x + a01 * __y;
287 const double y = a10 * __x + a11 * __y;
288
289 __x = x;
290 __y = y;
291 }

Member Data Documentation

◆ a00

double JMATH::JMatrix2D::a00
inherited

Definition at line 346 of file JMath/JMatrix2D.hh.

◆ a01

double JMATH::JMatrix2D::a01
inherited

Definition at line 346 of file JMath/JMatrix2D.hh.

◆ a10

double JMATH::JMatrix2D::a10
inherited

Definition at line 347 of file JMath/JMatrix2D.hh.

◆ a11

double JMATH::JMatrix2D::a11
inherited

Definition at line 347 of file JMath/JMatrix2D.hh.


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