Answered by:
Find angle in clockwise direction
Question
Answers

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/
 Marked as answer by amber zhangModerator Monday, April 09, 2012 2:56 AM
All replies


I think more information would be helpful here.
 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.

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/
 Marked as answer by amber zhangModerator Monday, April 09, 2012 2:56 AM