List of utility methods to do sin to cos
double | sinToCos(double angle, double sin) Fast way of computing cos(x) from x and sin(x). if ((-1e-5 < sin && sin < 1e-5) || sin > 0.99999 || sin < -0.99999) { return Math.cos(angle); angle = normAngle(angle); final double s = Math.sqrt(1 - sin * sin); return (angle < HALFPI || angle > ONEHALFPI) ? s : -s; |