Predefined Functions - exp
Description: ChaosPro automatically detects the input data type.
In order to calculate exp(z)=exp(x)*cos(y)+i*exp(x)*sin(y)
In order to calculate
quaternion fr_exp(quaternion q)
{
quaternion ret;
n = sqrt( sqr(real(loquat(q))) + sqr(imag(loquat(q))) +sqr(imag(q)) );
ex = exp(real(q));
f = ex*sin(n);
if (n != 0.0)
{
f = f/n;
}
c0 = ex*cos(n);
c1 = f*imag(q);
c2 = f*real(loquat(q));
c3 = f*imag(loquat(q));
ret = loquat(c2+flip(c3))+c0+flip(c1);
return(ret);
}
|
||||||||||||||||||||||