Yeah -- java.lang.Math.atan

Aaron

int l1x = x2 - x1;
int l1y = y2 - y1;
int l2x = x3 - x1;
int l2y = y3 - y1;
float tan1 = (float)l1y/(float)l1x;
float tan2 = (float)l2y/(float)l2x;
double ang1 = Math.atan(tan1);
double ang2 = Math.atan(tan2);
return Math.abs(Math.toDegrees(ang2-ang1));


On Wed, 2 Jun 2004, Ted Hill wrote:
> Give three points on a plane, P0, P1 and P2, form a line from P0 to P1
> and a line from P0 to P2.
>
>
>
> Is there a Java API to find the angle between these lines?
>
>
>
> Thank you,
>
>
>
> Ted Hill
>
>
>
>
>
>
>
>
> ===========================================================================
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
> of the message "signoff JAVA2D-INTEREST".  For general help, send email to
> [EMAIL PROTECTED] and include in the body of the message "help".
>

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA2D-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to