Determining the cosine of the angles between two lines using dot product

المشرف العام

Administrator
طاقم الإدارة
SCENARIO:I have a certain buffered region (lets say a one way road segment), which will have only one allowed direction represented by vector A. And, there are several other lines which may or may not be in the direction of the road, which are represented by the vector B.

I am trying to find the cosine of the angle between the lines using the cosine(angle)= (A • B) / ||A|| ||B||.

At first, I just wanted to know how to calculate this for one pair of VECTORS A and B. I want to use this to automate the process for the other lines (vector B) in order to find the cosine of the angle.

Is there any tools, so that I can use this model builder. OR there is some code that I can use for the calculation of cosine of the angle. Help will be highly appreciated.



أكثر...
 
أعلى