CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Apr 2002
    Location
    Australia
    Posts
    54

    Question Draw ARC between 2 lines

    Hi,

    I wonder if anyone has some ideas on how I can draw an ARC between two lines to show the angle between them. (example is attached).

    So far, I have used LineTo etc to draw the lines. I know the start and endpoints of both lines and have calculated each angle and the angle between them using standard trig functions. I can calculate the midpoint of the arc I wish to draw, but I am not sure how to proceed.

    I have tried the CDC::Arc function but I am not sure how to work out the bounding rectangle of the Arc. I have also tried the AngleArc function but I don't want the extra line to be displayed. Would it be better to draw the arc myself or am I just using the functions incorrectly? (my math is a bit rusty)

    Let me know what code I should post to recieve some help with this problem.

    thanks,
    Emelia

  2. #2
    Join Date
    Apr 2002
    Location
    Australia
    Posts
    54
    Trying attachment again
    Attached Images Attached Images  

  3. #3
    Join Date
    Nov 2001
    Location
    Beyond Juslibol
    Posts
    1,688
    If you don't want to use math you may do the following.

    Define a new clipping area wich will be the triangle that the two lines define (with the end points an the intersection point).

    Draw a circle with center in the intersection point.

    Restore the original clipping area.

  4. #4
    Join Date
    Apr 2002
    Location
    Australia
    Posts
    54

    Talking

    Thanks Doctor Luz. That was a simple solution that worked really well.

    Problem solved,
    Emelia

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured