Sep 10, 2001 #1 SteveD73 Programmer Jan 5, 2001 109 GB Hello Can anyone answer the following question: I have 2 lines with the following coords line 1 (x1, y1) - (x2, y2) line 2 (x1, y1) - (x3, y3) How can I calculate the angle between them? Thanks
Hello Can anyone answer the following question: I have 2 lines with the following coords line 1 (x1, y1) - (x2, y2) line 2 (x1, y1) - (x3, y3) How can I calculate the angle between them? Thanks
Sep 11, 2001 #2 tchouch Programmer Apr 18, 2001 300 DE For two Vectors v1(x1, y1, z1) and v2(x2, y2, z2): cos(v1, v2) = (x1*x2 + y1*y2 + z1*z2)/(sqrt(x1*x1 + y1*y1 + z1*z1) *sqrt(x2*x2 + y2*y2 + z2*z2)); Upvote 0 Downvote
For two Vectors v1(x1, y1, z1) and v2(x2, y2, z2): cos(v1, v2) = (x1*x2 + y1*y2 + z1*z2)/(sqrt(x1*x1 + y1*y1 + z1*z1) *sqrt(x2*x2 + y2*y2 + z2*z2));
Sep 11, 2001 Thread starter #3 SteveD73 Programmer Jan 5, 2001 109 GB I've tried the above formulae with no success. If the coords of the lines are (0, 0) - (10, -10) (0, 0) - (10, 10) The angle should be 45. However, the first part of equation (x1*x2 + y1*y2 + z1*z2) results in 0. 0/x = 0 Any sugestions on where im going wrong? Thanks Upvote 0 Downvote
I've tried the above formulae with no success. If the coords of the lines are (0, 0) - (10, -10) (0, 0) - (10, 10) The angle should be 45. However, the first part of equation (x1*x2 + y1*y2 + z1*z2) results in 0. 0/x = 0 Any sugestions on where im going wrong? Thanks
Sep 11, 2001 #4 Cagliostro Programmer Sep 13, 2000 4,226 GB as I see, there is 90 degrees, not 45. 45 are relative to OX or to OY, but not between themselves. Ion Filipski filipski@excite.com Upvote 0 Downvote
as I see, there is 90 degrees, not 45. 45 are relative to OX or to OY, but not between themselves. Ion Filipski filipski@excite.com