/* normalize to +/- 45 degree range */
y_abs = fabs(y);
x_abs = fabs(x);
- z = (y_abs < x_abs ? y_abs / x_abs : x_abs / y_abs);
+ //z = (y_abs < x_abs ? y_abs / x_abs : x_abs / y_abs);
+ if (y_abs < x_abs)
+ z = y_abs / x_abs;
+ else
+ z = x_abs / y_abs;
/* when ratio approaches the table resolution, the angle is */
/* best approximated with the argument itself... */
- if (z < TAN_MAP_RES) base_angle = z;
+ if (z < TAN_MAP_RES) base_angle = z;
else {
/* find index and interpolation value */
alpha = z * (REAL) TAN_MAP_SIZE - .5;