21bool HepRotation::setCols
22 (
const Hep3Vector & u1,
const Hep3Vector & u2,
const Hep3Vector & u3,
24 Hep3Vector & v1, Hep3Vector & v2, Hep3Vector & v3 )
const {
27 std::cerr <<
"HepRotation::setCols() - "
28 <<
"All three cols supplied for a Rotation are parallel --"
29 <<
"\n an arbitrary rotation will be returned" << std::endl;
30 setArbitrarily (u1, v1, v2, v3);
35 v2 = Hep3Vector(u2 - u1u2 * u1).unit();
37 if ( v3.dot(u3) >= 0 ) {
45void HepRotation::setArbitrarily (
const Hep3Vector & ccolX,
46 Hep3Vector & v1, Hep3Vector & v2, Hep3Vector & v3)
const {
52 v2 = v1.cross(Hep3Vector(0,0,1));
56 v2 = Hep3Vector(1,0,0);
77 double u1u2 = ucolX.
dot(ucolY);
78 double f12 = std::fabs(u1u2);
80 std::cerr <<
"HepRotation::set() - "
81 <<
"col's X and Y supplied for Rotation are not close to orthogonal"
84 double u1u3 = ucolX.
dot(ucolZ);
85 double f13 = std::fabs(u1u3);
87 std::cerr <<
"HepRotation::set() - "
88 <<
"col's X and Z supplied for Rotation are not close to orthogonal"
91 double u2u3 = ucolY.
dot(ucolZ);
92 double f23 = std::fabs(u2u3);
94 std::cerr <<
"HepRotation::set() - "
95 <<
"col's Y and Z supplied for Rotation are not close to orthogonal"
101 if ( (f12 <= f13) && (f12 <= f23) ) {
102 isRotation = setCols ( ucolX, ucolY, ucolZ, u1u2, v1, v2, v3 );
104 std::cerr <<
"HepRotation::set() - "
105 <<
"col's X Y and Z supplied form closer to a reflection than a Rotation "
106 <<
"\n col Z is set to col X cross col Y" << std::endl;
108 }
else if ( f13 <= f23 ) {
109 isRotation = setCols ( ucolZ, ucolX, ucolY, u1u3, v3, v1, v2 );
111 std::cerr <<
"HepRotation::set() - "
112 <<
"col's X Y and Z supplied form closer to a reflection than a Rotation "
113 <<
"\n col Y is set to col Z cross col X" << std::endl;
116 isRotation = setCols ( ucolY, ucolZ, ucolX, u2u3, v2, v3, v1 );
118 std::cerr <<
"HepRotation::set() - "
119 <<
"col's X Y and Z supplied form closer to a reflection than a Rotation "
120 <<
"\n col X is set to col Y cross col Z" << std::endl;
136 set (ccolX, ccolY, ccolZ);
142 set (rrowX, rrowY, rrowZ);
167 std::cerr <<
"HepRotation::rectify() - "
168 <<
"Attempt to rectify a Rotation with determinant <= 0" << std::endl;
171 double di = 1.0 / det;
196 double del =
delta();
double dot(const Hep3Vector &) const
static DLL_API double tolerance
HepRotation & setRows(const Hep3Vector &rowX, const Hep3Vector &rowY, const Hep3Vector &rowZ)
HepRotation & set(const Hep3Vector &axis, double delta)