|
|
This is from the 3.7-stable source:
DBL f_spiral(FPUContext *ctx, DBL *ptr, unsigned int) // 64
{
DBL r, r2, th, temp;
/* spiral shape *
* */
r = sqrt(PARAM_X * PARAM_X + PARAM_Z * PARAM_Z);
if ((PARAM_X == 0) && (PARAM_Z == 0))
PARAM_X = 0.000001;
th = atan2(PARAM_Z, PARAM_X);
r = r + PARAM(0) * th / TWO_M_PI;
r2 = fmod(r, PARAM(0)) - PARAM(0) * 0.5;
if (PARAM(5) == 1)
r2 = sqrt(r2 * r2 + PARAM_Y * PARAM_Y);
else if (PARAM(5) != 0)
{
temp = 2 / PARAM(5);
r2 = pow((pow(fabs(r2), temp) + pow(fabs(PARAM_Y), temp)), 1. / temp);
}
else
r2 = max(fabs(r2), fabs(PARAM_Y));
r = sqrt(PARAM_X * PARAM_X + PARAM_Y * PARAM_Y + PARAM_Z * PARAM_Z);
return (-min(PARAM(2) - r, PARAM(1) - min(r2, r)));
}
Post a reply to this message
|
|