Results 1 to 1 of 1

Thread: Update direction of arc from three points

  1. #1
    May 2009

    Update direction of arc from three points

    I want to find the direction of the arc drawn from three points for programming purpose.
    Depending on Point2 I have to decide whether to draw clock wise or counterclock wise arc from Point1 to Point3 through point2.

    My Logic is working in most cases except one case, as shown in figure.

    Point1= P1 =(P1X,P1Y)
    Point2= P2 =(P2X,P2Y)
    Point3= P3 =(P3X,P3Y)
    CenterPoint of Arc C(CX,CY) - I am calculating center from three points

    P1P3angle = Angle from Point1 to Point3
    P1P2angle = Angle from Point1 to Point2

    diff = p1p3angle - p1p2angle;

    by Default: Direction = CounterClockwise
    if (diff < 0 || diff > 180)
    Direction = Clockwise
    if (p1p3angle == 0)
    if (AngleDifference < -180)
    Direction = CounterClockwise
    Direction = Clockwise
    if (p1p3angle == 90)
    if (diff< -180)
    Direction = CounterClockwise
    Attached Thumbnails Attached Thumbnails Update direction of arc from three points-sample.jpg  
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. Replies: 8
    Last Post: Aug 24th 2010, 09:18 AM
  2. Dip angle and direction of a plane described by 3 points
    Posted in the Advanced Applied Math Forum
    Replies: 1
    Last Post: Mar 26th 2009, 07:56 AM
  3. Replies: 2
    Last Post: Mar 23rd 2009, 11:56 AM

Search Tags

/mathhelpforum @mathhelpforum