**DONOTDELETE**
(Unregistered)
11/20/05 06:58 PM
A regular way to optimize

I have noticed that remplacing these calls :
Math.cos(theta)
and
Math.sin(theta)

... by this kind of calls :
-Math.cos(theta % Math.PI - Math.PI)
and
-Math.sin(theta % Math.PI - Math.PI)

... the program runs about 7 times faster on my machine (i don't know why...) ! It is better than using JNI, and more accurate than using lookup tables since it works for any value.



Contact us JavaWorld

Powered by UBB.threads™ 6.5.5

Featured White Papers


RESEARCH CENTERS: Java Standard Edition | Java Enterprise Edition | Java Micro Edition | Development Tools
About Us | Advertise | Contact Us | Terms of Service/Privacy
Copyright, 2006-2008 Network World, Inc. All rights reserved.