1 #ifndef Geom_newTkRotation_H
2 #define Geom_newTkRotation_H
18 std::ostream& operator<<(std::ostream& s, const TkRotation<T>&
r);
20 std::ostream& operator<<(std::ostream& s, const TkRotation2D<T>&
r);
22 namespace geometryDetails {
40 TkRotation(
T xx,
T xy,
T xz,
T yx,
T yy,
T yz,
T zx,
T zy,
T zz) :
rot(xx, xy, xz, yx, yy, yz, zx, zy, zz) {}
42 TkRotation(
const T*
p) :
rot(p[0], p[1], p[2], p[3], p[4], p[5], p[6], p[7], p[8]) {}
51 rot.axis[2] = uZ.basicVector().v;
133 template <
typename U>
146 template <
class Scalar>
149 xy() * v.
x() +
yy() * v.
y() +
zy() * v.
z(),
150 xz() * v.
x() +
yz() * v.
y() +
zz() * v.
z());
179 fabs(newX.
mag2() - 1.) > del || fabs(newY.
mag2() - 1.) > del || fabs(newZ.
mag2() - 1.) > del ||
180 fabs(newX.
dot(newY)) > del || fabs(newY.
dot(newZ)) > del || fabs(newZ.
dot(newX)) > del) {
185 TkRotation(newX.
x(), newY.
x(), newZ.
x(), newX.
y(), newY.
y(), newZ.
y(), newX.
z(), newY.
z(), newZ.
z()));
193 T xx()
const {
return rot.axis[0].arr[0]; }
194 T xy()
const {
return rot.axis[0].arr[1]; }
195 T xz()
const {
return rot.axis[0].arr[2]; }
196 T yx()
const {
return rot.axis[1].arr[0]; }
197 T yy()
const {
return rot.axis[1].arr[1]; }
198 T yz()
const {
return rot.axis[1].arr[2]; }
199 T zx()
const {
return rot.axis[2].arr[0]; }
200 T zy()
const {
return rot.axis[2].arr[1]; }
201 T zz()
const {
return rot.axis[2].arr[2]; }
213 template <
class T,
class U>
216 r.
yx() * v.
x() + r.
yy() * v.
y() + r.
yz() * v.
z(),
217 r.
zx() * v.
x() + r.
zy() * v.
y() + r.
zz() * v.
z());
220 template <
class T,
class U>
223 return RT(a.
xx() * b.
xx() + a.
xy() * b.
yx() + a.
xz() * b.
zx(),
Basic3DVector< T > BasicVector
Basic3DVector< T > z() const
Basic3DVector< T > operator*(const Basic3DVector< T > &v) const
Vector3DBase< typename PreciseFloatType< T, U >::Type, FrameTag > cross(const Vector3DBase< U, FrameTag > &v) const
TkRotation(const GlobalVector &aX, const GlobalVector &aY)
T y() const
Cartesian y coordinate.
TkRotation2D(mathSSE::Rot2< T > const &irot)
T x() const
Cartesian x coordinate.
TkRotation2D(const BasicVector &uX, const BasicVector &uY)
Basic3DVector< T > y() const
TkRotation(const Basic3DVector< T > &axis, T phi)
TkRotation & transform(const TkRotation &b)
Sin< T >::type sin(const T &t)
Geom::Theta< T > theta() const
Basic3DVector unit() const
TkRotation operator*(const TkRotation &b) const
Basic3DVector cross(const Basic3DVector &lh) const
Vector product, or "cross" product, with a vector of same type.
Basic3DVector< Scalar > multiplyInverse(const Basic3DVector< Scalar > &v) const
TkRotation2D transposed() const
TkRotation multiplyInverse(const TkRotation &b) const
Geom::Phi< T > phi() const
TkRotation(const TkRotation< U > &a)
Vector3DBase< T, GlobalTag > GlobalVector
TkRotation & rotateAxes(const Basic3DVector< T > &newX, const Basic3DVector< T > &newY, const Basic3DVector< T > &newZ)
Basic3DVector< T > x() const
Basic2DVector unit() const
Basic3DVector< T > rotate(const Basic3DVector< T > &v) const
T z() const
Cartesian z coordinate.
TkRotation(T xx, T xy, T xz, T yx, T yy, T yz, T zx, T zy, T zz)
Basic3DVector< T > operator*(const Basic2DVector< T > &v) const
Cos< T >::type cos(const T &t)
Basic3DVector< T > multiplyInverse(const Basic2DVector< T > &v) const
TkRotation(const BasicVector &aX, const BasicVector &aY)
TkRotation(mathSSE::Rot3< T > const &irot)
T y() const
Cartesian y coordinate.
Vector3DBase unit() const
Basic2DVector< T > xy() const
TkRotation & operator*=(const TkRotation &b)
TkRotation(const GlobalVector &uX, const GlobalVector &uY, const GlobalVector &uZ)
Basic3DVector< T > rotateBack(const Basic3DVector< T > &v) const
TkRotation2D(const BasicVector &aX)
TkRotation transposed() const
std::ostream & operator<<< double >(std::ostream &s, const TkRotation< double > &r)
BasicVector rotateBack(const BasicVector &v) const
TkRotation2D(T xx, T xy, T yx, T yy)
MatrixMeschach operator*(const MatrixMeschach &mat1, const MatrixMeschach &mat2)
std::ostream & operator<<< float >(std::ostream &s, const TkRotation< float > &r)
Basic3DVector< T > multiplyInverse(const Basic3DVector< T > &v) const
Basic2DVector< T > BasicVector
const BasicVectorType & basicVector() const
T x() const
Cartesian x coordinate.
T mag2() const
The vector magnitude squared. Equivalent to vec.dot(vec)
T dot(const Basic3DVector &rh) const
Scalar product, or "dot" product, with a vector of same type.
TkRotation(const BasicVector &uX, const BasicVector &uY, const BasicVector &uZ)
BasicVector rotate(const BasicVector &v) const