# Find angle in clockwise direction

### Question

•  I have 2 lines connected, represented by 3 points(LAT, LONG), and I want to find the angle between them. But not just the regular angle, I want to find the angle always in a CLOCKWISE motion.

Thanks ..

Mayukh Roy

Monday, April 02, 2012 7:00 AM

• As Jared says, sample data and the expected outcome would be really useful.

Since you're talking about lat/long, I'll assume you're using the geography datatype; In which case, I think you want to calculate the difference between the final bearing of the great elliptic arc between p1 and p2, compared to the initial bearing of the great elliptic arc between p2 and p3.... is that right?

If so, you might find the formula here helpful: http://williams.best.vwh.net/avform.htm#Crs

twitter: @alastaira blog: http://alastaira.wordpress.com/

Thursday, April 05, 2012 6:43 AM

### All replies

• hi

you can make use of STDistance + Angle

Wednesday, April 04, 2012 1:00 PM

• Are the points you are dealing with geometric or geographical?
• If the three points define two connected lines, which point is the vertex?
• Could you provide an example or two of the data points you will be working with?

You may want to look at the following page:

This is not a complete answer (certainly not for the clockwise requirement), but the code here could provide a starting point for you.

Thank you and have a good day.

Wednesday, April 04, 2012 8:39 PM
• As Jared says, sample data and the expected outcome would be really useful.

Since you're talking about lat/long, I'll assume you're using the geography datatype; In which case, I think you want to calculate the difference between the final bearing of the great elliptic arc between p1 and p2, compared to the initial bearing of the great elliptic arc between p2 and p3.... is that right?

If so, you might find the formula here helpful: http://williams.best.vwh.net/avform.htm#Crs

twitter: @alastaira blog: http://alastaira.wordpress.com/

Thursday, April 05, 2012 6:43 AM