none
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.

    please suggest.

    Thanks ..


    Mayukh Roy

    Monday, April 02, 2012 7:00 AM

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/

    Thursday, April 05, 2012 6:43 AM
    Answerer

All replies

  • hi

    you can make use of STDistance + Angle

    Wednesday, April 04, 2012 1:00 PM
  • 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:

    http://www.spatialdbadvisor.com/sql_server_blog/184/cogo-calculating-the-bearing-between-two-points-sql-server-2008-spatial

    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
    Answerer