1 #ifndef Geom_oldTkRotation_H 2 #define Geom_oldTkRotation_H 17 std::ostream & operator<<( std::ostream& s, const TkRotation<T>&
r);
19 std::ostream & operator<<( std::ostream& s, const TkRotation2D<T>&
r);
51 TkRotation(
const GlobalVector & aX,
const GlobalVector & aY) {
53 GlobalVector uX = aX.
unit();
54 GlobalVector uY = aY.
unit();
55 GlobalVector uZ(uX.
cross(uY));
67 TkRotation(
const GlobalVector & aX,
const GlobalVector & aY,
68 const GlobalVector & aZ) :
71 R31( aZ.x()),
R32( aZ.y()),
R33( aZ.z()) {}
100 *
this = (tmpRoty*tmpRotz).multiplyInverse(*
this);
136 template <
typename U>
159 return rotateBack(v);
212 return *
this = b.operator * (*this);
228 fabs(newX.
mag2()-1.) > del ||
229 fabs(newY.
mag2()-1.) > del ||
230 fabs(newZ.
mag2()-1.) > del ||
231 fabs(newX.
dot(newY)) > del ||
232 fabs(newY.
dot(newZ)) > del ||
233 fabs(newZ.
dot(newX)) > del) {
238 newX.
y(), newY.
y(), newZ.
y(),
239 newX.
z(), newY.
z(), newZ.
z()));
273 template <
class T,
class U>
276 r.
yx()*v.
x() + r.
yy()*v.
y() + r.
yz()*v.
z(),
277 r.
zx()*v.
x() + r.
zy()*v.
y() + r.
zz()*v.
z());
280 template <
class T,
class U>
284 return RT( a.
xx()*b.
xx() + a.
xy()*b.
yx() + a.
xz()*b.
zx(),
307 axis[0] = BasicVector(xx,xy);
308 axis[1] =BasicVector(yx, yy);
312 axis[0] = BasicVector(p[0],p[1]);
313 axis[1] = BasicVector(p[2],p[3]);
318 BasicVector uX = aX.
unit();
319 BasicVector uY(-uX.
y(),uX.
x());
332 BasicVector
x()
const {
return axis[0];}
333 BasicVector
y()
const {
return axis[1];}
338 axis[0][1], axis[1][1]
342 BasicVector
rotate(
const BasicVector&
v)
const {
347 return v[0]*axis[0] + v[1]*axis[1];
Basic3DVector< T > z() const
Basic3DVector< T > operator*(const Basic3DVector< T > &v) const
TkRotation(const GlobalVector &aX, const GlobalVector &aY)
T y() const
Cartesian y coordinate.
T x() const
Cartesian x coordinate.
TkRotation2D(const BasicVector &uX, const BasicVector &uY)
Basic3DVector< T > y() const
TkRotation(const GlobalVector &aX, const GlobalVector &aY, const GlobalVector &aZ)
TkRotation(const Basic3DVector< T > &axis, T phi)
TkRotation & transform(const TkRotation &b)
Sin< T >::type sin(const T &t)
Geom::Theta< T > theta() const
TkRotation operator*(const TkRotation &b) const
Vector3DBase< T, GlobalTag > GlobalVector
TkRotation2D transposed() const
TkRotation multiplyInverse(const TkRotation &b) const
Geom::Phi< T > phi() const
std::ostream & operator<< < double >(std::ostream &s, const TkRotation< double > &r)
TkRotation(const TkRotation< U > &a)
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
Vector3DBase< typename PreciseFloatType< T, U >::Type, FrameTag > cross(const Vector3DBase< U, FrameTag > &v) const
Cos< T >::type cos(const T &t)
Basic3DVector< T > multiplyInverse(const Basic2DVector< T > &v) const
def transposed(lists, defaultval=None)
T y() const
Cartesian y coordinate.
Vector3DBase unit() const
std::ostream & operator<< < float >(std::ostream &s, const TkRotation< float > &r)
TkRotation & operator*=(const TkRotation &b)
Basic3DVector< T > rotateBack(const Basic3DVector< T > &v) const
Basic3DVector< U > operator*(const TkRotation< T > &r, const Basic3DVector< U > &v)
TkRotation2D(const BasicVector &aX)
TkRotation transposed() const
BasicVector rotateBack(const BasicVector &v) const
TkRotation2D(T xx, T xy, T yx, T yy)
Basic3DVector< T > multiplyInverse(const Basic3DVector< T > &v) const
Basic2DVector< T > BasicVector
def rotate(angle, cx=0, cy=0)
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.
BasicVector rotate(const BasicVector &v) const