89 double tmp0 =
fabs(data[0]);
90 double tmp1 =
fabs(data[1]);
94 return tmp0*
sqrt(1+
sqr(tmp1/tmp0));
96 return tmp1*
sqrt(1+
sqr(tmp0/tmp1));
103 double v = this->
Norm();
119 tmp1 =
fabs(data[0]);
120 tmp2 =
fabs(data[1]);
128 return tmp1*
sqrt(1+
sqr(data[1]/data[0])+
sqr(data[2]/data[0]));
130 return tmp2*
sqrt(1+
sqr(data[0]/data[2])+
sqr(data[1]/data[2]));
135 return tmp2*
sqrt(1+
sqr(data[0]/data[1])+
sqr(data[2]/data[1]));
137 return tmp1*
sqrt(1+
sqr(data[0]/data[2])+
sqr(data[1]/data[2]));
146 double v = this->
Norm();
158 return (
Equal(a.data[0],
b.data[0],
eps) &&
172 n=
sqrt(
sqr(data[0])+
sqr(data[3])+
sqr(data[6]));n=(n>1
e-10)?1.0/n:0.0;data[0]*=n;data[3]*=n;data[6]*=n;
173 n=
sqrt(
sqr(data[1])+
sqr(data[4])+
sqr(data[7]));n=(n>1
e-10)?1.0/n:0.0;data[1]*=n;data[4]*=n;data[7]*=n;
174 n=
sqrt(
sqr(data[2])+
sqr(data[5])+
sqr(data[8]));n=(n>1
e-10)?1.0/n:0.0;data[2]*=n;data[5]*=n;data[8]*=n;
197 double ca1,cb1,cc1,sa1,sb1,sc1;
198 ca1 =
cos(yaw); sa1 =
sin(yaw);
199 cb1 =
cos(pitch);sb1 =
sin(pitch);
200 cc1 =
cos(roll);sc1 =
sin(roll);
201 return Rotation(ca1*cb1,ca1*sb1*sc1 - sa1*cc1,ca1*sb1*cc1 + sa1*sc1,
202 sa1*cb1,sa1*sb1*sc1 + ca1*cc1,sa1*sb1*cc1 - ca1*sc1,
203 -sb1,cb1*sc1,cb1*cc1);
210 roll = -
sign(data[6]) *
atan2(data[1], data[4]);
211 pitch= -
sign(data[6]) *
PI / 2;
214 roll =
atan2(data[7], data[8]);
216 yaw =
atan2(data[3], data[0]);
221 double sa,ca,sb,cb,sg,cg;
222 sa =
sin(Alfa);ca =
cos(Alfa);
223 sb =
sin(Beta);cb =
cos(Beta);
224 sg =
sin(Gamma);cg =
cos(Gamma);
225 return Rotation( ca*cb*cg-sa*sg, -ca*cb*sg-sa*cg, ca*sb,
226 sa*cb*cg+ca*sg, -sa*cb*sg+ca*cg, sa*sb,
238 gamma=
atan2(-data[1],data[0]);
241 gamma=
atan2(data[1],-data[0]);
244 alfa=
atan2(data[5], data[2]);
246 gamma=
atan2(data[7], -data[6]);
255 double ct =
cos(angle);
256 double st =
sin(angle);
261 ct + vt*rotvec(0)*rotvec(0),
262 -rotvec(2)*st + vt*rotvec(0)*rotvec(1),
263 rotvec(1)*st + vt*rotvec(0)*rotvec(2),
264 rotvec(2)*st + vt*rotvec(1)*rotvec(0),
265 ct + vt*rotvec(1)*rotvec(1),
266 -rotvec(0)*st + vt*rotvec(1)*rotvec(2),
267 -rotvec(1)*st + vt*rotvec(2)*rotvec(0),
268 rotvec(0)*st + vt*rotvec(2)*rotvec(1),
269 ct + vt*rotvec(2)*rotvec(2)
279 double ct =
cos(angle);
280 double st =
sin(angle);
283 ct + vt*rotvec(0)*rotvec(0),
284 -rotvec(2)*st + vt*rotvec(0)*rotvec(1),
285 rotvec(1)*st + vt*rotvec(0)*rotvec(2),
286 rotvec(2)*st + vt*rotvec(1)*rotvec(0),
287 ct + vt*rotvec(1)*rotvec(1),
288 -rotvec(0)*st + vt*rotvec(1)*rotvec(2),
289 -rotvec(1)*st + vt*rotvec(2)*rotvec(0),
290 rotvec(0)*st + vt*rotvec(2)*rotvec(1),
291 ct + vt*rotvec(2)*rotvec(2)
303 (data[3]-data[1]) )/2;
305 double sa = axis.
Norm();
306 double ca = (data[0]+data[4]+data[8]-1)/2.0;
318 }
else if (data[4] > 0.0) {
333 Vector2 axis(data[7], -data[1]);
334 double norm = axis.Normalize();
336 norm = (data[4] < 0.0) ?
PI : 0.0;
355 double ca = (data[0]+data[4]+data[8]-1)/2.0;
363 double z =
sqrt( (data[8]+1)/2 );
364 double x = (data[2])/2/
z;
365 double y = (data[5])/2/
z;
369 double angle =
acos(ca);
370 double sa =
sin(angle);
371 axis =
Vector((data[7]-data[5])/2/sa,
372 (data[2]-data[6])/2/sa,
373 (data[3]-data[1])/2/sa );
381 return ( a.data[0]==
b.data[0] &&
382 a.data[1]==
b.data[1] &&
383 a.data[2]==
b.data[2] &&
384 a.data[3]==
b.data[3] &&
385 a.data[4]==
b.data[4] &&
386 a.data[5]==
b.data[5] &&
387 a.data[6]==
b.data[6] &&
388 a.data[7]==
b.data[7] &&
389 a.data[8]==
b.data[8] );
static double angle(const Eigen::Vector3d &v1, const Eigen::Vector3d &v2)
ATTR_WARN_UNUSED_RESULT const BMVert const BMEdge * e
ATTR_WARN_UNUSED_RESULT const BMVert * v
SIMD_FORCE_INLINE const btScalar & z() const
Return the z value.
SIMD_FORCE_INLINE btScalar norm() const
Return the norm (length) of the vector.
represents a frame transformation in 3D space (rotation + translation)
Rotation M
Orientation of the Frame.
void Make4x4(double *d)
Reads data from an double array.
static Frame DH_Craig1989(double a, double alpha, double d, double theta)
Vector p
origine of the Frame
static Frame DH(double a, double alpha, double d, double theta)
represents rotations in 3 dimensional space.
void GetRPY(double &roll, double &pitch, double &yaw) const
double GetRotAngle(Vector &axis, double eps=epsilon) const
static Rotation Rot2(const Vector &rotvec, double angle)
Along an arbitrary axes. rotvec should be normalized.
void GetEulerZYZ(double &alfa, double &beta, double &gamma) const
static Rotation Rot(const Vector &rotaxis, double angle)
static Rotation EulerZYZ(double Alfa, double Beta, double Gamma)
static Rotation RPY(double roll, double pitch, double yaw)
double Normalize(double eps=epsilon)
Vector2()
Does not initialise to Zero().
A concrete implementation of a 3 dimensional vector class.
friend Vector Normalize(const Vector &a, double eps)
return a normalized vector
double Normalize(double eps=epsilon)
Vector()
Does not initialise the Vector to zero. use Vector::Zero() or SetToZero for that.
local_group_size(16, 16) .push_constant(Type b
local_group_size(16, 16) .push_constant(Type rhs
ccl_device_inline float2 fabs(const float2 a)
INLINE Rall1d< T, V, S > sin(const Rall1d< T, V, S > &arg)
INLINE Rall1d< T, V, S > sqrt(const Rall1d< T, V, S > &arg)
bool operator==(const Rotation &a, const Rotation &b)
INLINE Rall1d< T, V, S > atan2(const Rall1d< T, V, S > &y, const Rall1d< T, V, S > &x)
INLINE Rall1d< T, V, S > sqr(const Rall1d< T, V, S > &arg)
const double PI
the value of pi
INLINE Rall1d< T, V, S > acos(const Rall1d< T, V, S > &x)
Rotation operator*(const Rotation &lhs, const Rotation &rhs)
INLINE Rall1d< T, V, S > cos(const Rall1d< T, V, S > &arg)
double epsilon
default precision while comparing with Equal(..,..) functions. Initialized at 0.0000001.
IMETHOD bool Equal(const VectorAcc &, const VectorAcc &, double=epsilon)
ccl_device_inline float beta(float x, float y)