Answered Find angle in clockwise direction

  • lunes, 02 de abril de 2012 7:00
     
     

     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

Todas las respuestas

  • miércoles, 04 de abril de 2012 13:00
     
     

    hi

    you can make use of STDistance + Angle

  • miércoles, 04 de abril de 2012 20:39
     
     

    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.

  • jueves, 05 de abril de 2012 6:43
    Usuario que responde
     
     Respondida

    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/