Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Problem using atan2 function

807589Aug 7 2008 — edited Aug 8 2008
Hi everyone, I'm developing an application that needs to calculate the angle between two vectors. While this is fairly simple, you just need to use the Math.atan2() function, i am having a few problems.

Here's a code snippet:
alpha = (Math.atan2((tx*ry)-(rx*ty), (tx*rx)+(ty*ry)) % (2*Math.PI)) ;
Strangely enough, this gives me the following error: "The method atan2(double, double) is undefined for type Math"
This should only occur if the method atan2 weren't implemented in the Math library.. but from the javadoc and the GIS it definitively is!

I'm confused and stuck, any ideas? (i'm using jdk 1.6.0_07)
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 5 2008
Added on Aug 7 2008
20 comments
515 views