Please join us at the new JavaWorld Q&A Forums. Your existing login will work there. The discussions here are now read-only.


JavaWorld Talkback >> 958403

jls
Unregistered




A regular way to optimize
      11/20/05 06:58 PM

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.

Post Extras Print Post   Remind Me!     Notify Moderator


Entire topic
Subject Posted by Posted on
* A regular way to optimize jls 11/20/05 06:58 PM

Extra information
0 registered and 1 anonymous users are browsing this forum.

Moderator:   



Forum Permissions
      You cannot start new topics
      You cannot reply to topics
      HTML is disabled
      UBBCode is enabled

Rating:
Thread views: 5416

Rate this thread

Jump to

Contact us JavaWorld

Powered by UBB.threads™ 6.5.5