sin and cos in java
807591May 16 2008 — edited May 16 2008Replacing these calls
Math.cos(theta)
and
Math.sin(theta)
with something like this:
-Math.cos(theta % Math.PI - Math.PI)
and
-Math.sin(theta % Math.PI - Math.PI)
makes it much faster. Why is that? Any explanation?
Also, is there any trick to make sqrt method faster like the above trick does with cos and sin