Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
QuaternionXaxial.cxx
Go to the documentation of this file.
1// @(#)root/mathcore:$Id$
2// Authors: W. Brown, M. Fischler, L. Moneta 2005
3
4/**********************************************************************
5 * *
6 * Copyright (c) 2005 , LCG ROOT FNAL MathLib Team *
7 * *
8 * *
9 **********************************************************************/
10
11// Implementation file for quaternion times other non-axial rotations.
12// Decoupled from main Quaternion implementations.
13//
14// Created by: Mark Fischler Tues July 19, 2005
15//
16// Last update: $Id$
17//
19
21
23
24namespace ROOT {
25
26namespace ROOT_MATH_ARCH {
27
28// Although the same technique would work with axial rotations,
29// we know that two of the four quaternion components will be zero,
30// and we exploit that knowledge:
31
33{
34 // combination with a RotationX
35 Quaternion q(rx);
36 return Quaternion(U() * q.U() - I() * q.I(), I() * q.U() + U() * q.I(), J() * q.U() + K() * q.I(),
37 K() * q.U() - J() * q.I());
38}
39
41{
42 // combination with a RotationY
43 Quaternion q(ry);
44 return Quaternion(U() * q.U() - J() * q.J(), I() * q.U() - K() * q.J(), J() * q.U() + U() * q.J(),
45 K() * q.U() + I() * q.J());
46}
47
49{
50 // combination with a RotationZ
52 return Quaternion(U() * q.U() - K() * q.K(), I() * q.U() + J() * q.K(), J() * q.U() - I() * q.K(),
53 K() * q.U() + U() * q.K());
54}
55
57{
58 return Quaternion(r) * q; // TODO: improve performance
59}
60
62{
63 return Quaternion(r) * q; // TODO: improve performance
64}
65
67{
68 return Quaternion(r) * q; // TODO: improve performance
69}
70
71} // namespace ROOT_MATH_ARCH
72} // namespace ROOT
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t r
float * q
Rotation class with the (3D) rotation represented by a unit quaternion (u, i, j, k).
Definition Quaternion.h:52
Scalar U() const
Access to the four quaternion components: U() is the coefficient of the identity Pauli matrix,...
Definition Quaternion.h:180
AVector operator*(const AVector &v) const
Overload operator * for rotation on a vector.
Definition Quaternion.h:255
Quaternion()
Default constructor (identity rotation)
Definition Quaternion.h:62
Rotation class representing a 3D rotation about the X axis by the angle of rotation.
Definition RotationX.h:45
Rotation class representing a 3D rotation about the Y axis by the angle of rotation.
Definition RotationY.h:45
Rotation class representing a 3D rotation about the Z axis by the angle of rotation.
Definition RotationZ.h:45
AxisAngle operator*(RotationX const &r1, AxisAngle const &r2)
Multiplication of an axial rotation by an AxisAngle.