150 public JMath<JRotation3D>
177 const double ct = cos(dir.
getTheta());
178 const double st = sin(dir.
getTheta());
179 const double cp = cos(dir.
getPhi());
180 const double sp = sin(dir.
getPhi());
199 const double ct = dir.
getDZ();
200 const double st = sqrt((1.0 + ct)*(1.0 - ct));
201 const double phi = atan2(dir.
getDY(), dir.
getDX());
202 const double cp = cos(phi);
203 const double sp = sin(phi);
222 const double ct = dir.
getDZ();
223 const double st = sqrt((1.0 + ct)*(1.0 - ct));
224 const double phi = atan2(dir.
getDY(), dir.
getDX());
225 const double cp = cos(phi);
226 const double sp = sin(phi);
284 const double a2 = Q.
getA()*Q.
getA();
285 const double b2 = Q.
getB()*Q.
getB();
286 const double c2 = Q.
getC()*Q.
getC();
287 const double d2 = Q.
getD()*Q.
getD();
289 const double ab = Q.
getA()*Q.
getB();
290 const double ac = Q.
getA()*Q.
getC();
291 const double ad = Q.
getA()*Q.
getD();
293 const double bc = Q.
getB()*Q.
getC();
294 const double bd = Q.
getB()*Q.
getD();
296 const double cd = Q.
getC()*Q.
getD();
298 a00 = a2 + b2 - c2 - d2;
a01 = 2.0*bc - 2.0*ad;
a02 = 2.0*bd + 2.0*ac;
299 a10 = 2.0*bc + 2.0*ad;
a11 = a2 - b2 + c2 - d2;
a12 = 2.0*cd - 2.0*ab;
300 a20 = 2.0*bd - 2.0*ac;
a21 = 2.0*cd + 2.0*ab;
a22 = a2 - b2 - c2 + d2;
322 const double q2 = 0.25 * (1.0 +
a00 +
a11 +
a22);
326 const double a = sqrt(q2);
327 const double w = 0.25 / a;
328 const double b = (
a21 -
a12) * w;
329 const double c = (
a02 -
a20) * w;
330 const double d = (
a10 -
a01) * w;
373 void rotate(
double& __x,
double& __y,
double& __z)
const
375 const double x =
a00 * __x +
a01 * __y +
a02 * __z;
376 const double y =
a10 * __x +
a11 * __y +
a12 * __z;
377 const double z =
a20 * __x +
a21 * __y +
a22 * __z;
394 const double x =
a00 * __x +
a10 * __y +
a20 * __z;
395 const double y =
a01 * __x +
a11 * __y +
a21 * __z;
396 const double z =
a02 * __x +
a12 * __y +
a22 * __z;
Base class for data structures with artithmetic capabilities.
Data structure for vector in two dimensions.
Data structure for angles in three dimensions.
double getTheta() const
Get theta angle.
double getPhi() const
Get phi angle.
Data structure for unit quaternion in three dimensions.
JQuaternion3D & normalise()
Normalise quaternion.
double getB() const
Get b value.
double getD() const
Get d value.
double getC() const
Get c value.
double getA() const
Get a value.
JRotation3D(const JRotation3Y &R)
Constructor.
const JRotation3D & getRotation() const
Get rotation.
JRotation3D & transpose()
Transpose.
JRotation3D(const JRotation3Z &R)
Constructor.
void rotate_back(double &__x, double &__y, double &__z) const
Rotate back.
JRotation3D(const JRotation3X &R)
Constructor.
JRotation3D(const JVersor3D &dir)
Constructor.
JRotation3D(const JQuaternion3D &Q)
Constructor.
JRotation3D()
Default constructor (= identity matrix).
JRotation3D & mul(const JRotation3D &A, const JRotation3D &B)
Matrix multiplication.
JRotation3D(const JAngle3D &dir)
Constructor.
void rotate(double &__x, double &__y, double &__z) const
Rotate.
JRotation3D(const JVersor3Z &dir)
Constructor.
JRotation3X(const double y, const double z)
Constructor.
JRotation3X(const double phi)
Constructor.
JRotation3X()
Default constructor (= identity matrix).
JRotation3Y()
Default constructor (= identity matrix).
JRotation3Y(const double x, const double z)
Constructor.
JRotation3Y(const double phi)
Constructor.
JRotation3Z()
Default constructor (= identity matrix).
JRotation3Z(const double x, const double y)
Constructor.
JRotation3Z(const double phi)
Constructor.
Data structure for normalised vector in three dimensions.
double getDY() const
Get y direction.
double getDX() const
Get x direction.
double getDZ() const
Get z direction.
Data structure for normalised vector in positive z-direction.
double getDZ() const
Get z direction.
double getDY() const
Get y direction.
double getDX() const
Get x direction.
JMatrix3D & mul(const double factor)
Scale matrix.
JMatrix3D & transpose()
Transpose.
JMatrix3D & setIdentity()
Set to identity matrix.
Auxiliary classes and methods for 3D geometrical objects and operations.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Auxiliary base class for aritmetic operations of derived class types.