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

Pages: 1
jls
Unregistered




A regular way to optimize
      #24102 - 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  
Pages: 1



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

Moderator:   

Print Topic

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

Rating:
Topic views: 5416

Rate this topic

Jump to

Contact us JavaWorld

Powered by UBB.threads™ 6.5.5