18 #ifndef __QUATERNION_H 19 #define __QUATERNION_H 83 return ((a.
r==b.
r)&&(a.
i==b.
i)&&(a.
j==b.
j)&&(a.
k=b.
k));
95 for (
int i=1;
i<b;
i++) r=
qmul(r,a);
101 return sqrt(a.
r*a.
r+a.
i*a.
i+a.
j*a.
j+a.
k*a.
k);
189 if (c.
i>0) printf(
"+%fi",c.
i);
190 if (c.
i<0) printf(
"%fi",c.
i);
191 if (c.
j>0) printf(
"+%fi",c.
j);
192 if (c.
j<0) printf(
"%fi",c.
j);
193 if (c.
k>0) printf(
"+%fi",c.
k);
194 if (c.
k<0) printf(
"%fi",c.
k);
quaternion qadd(quaternion a, quaternion b)
bool isEqualE(quaternion a, quaternion b)
quaternion qpos(quaternion a)
quaternion qneg(quaternion a)
quaternion qscale(double s, quaternion a)
bool isReal(quaternion x)
quaternion qsub(quaternion a, quaternion b)
bool isEqual(quaternion a, quaternion b)
quaternion qabs(quaternion a)
quaternion qmul(quaternion a, quaternion b)
quaternion qinv(quaternion a)
quaternion cpow(quaternion a, int b)
void qprint(quaternion c)
void rotate(double *x, double *y, double *z, quaternion q)
quaternion qconj(quaternion a)
quaternion qNormalize(quaternion q)