drawing circle/arcs---heelp

I am using following to draw circles

where originX,Y is is center…vectorX1,Y1 are points to be drawn

for(angle=0.0f;angle le (2.0f3.14159);angle+=0.01f)

now i want to improve my application by drawing diagrams that have both lines(straight edges) and curves. whenever user want to add a arc/circle the drawing should start from the end point of the last line drawn in this way arc can be made upward or downward…I have tried to modify the above code but there is a distortion…please remember that circles are being drawn ok but arcs are a problem as the code starts from a point away from the endpoint of the last drawn line
kindly help

PS le means less than or equal —tags not allowed:)

You can check out the GLU functions ‘gluPartialDisk’ for arcs and ‘gluDisk’ for drawing circles.

If you want the arcs and circles to appear similar to your lines, then call the gluQuadricDrawStyle routine.

You saidf in your other post that you are making an Autocad-type application? If you are plotting drawing elements taken from autocad, remember that you have to convert the angles.
Autocad defines zero degrees as the positive x axis, while opengl uses the positive y axis.

thanks for the reply…
could please expalin in a little detail how I can use gluPartialDisk to draw an arc …arc will start at an endpoint of a line…and from other end where arc finishes next line will continue


These are the relevant lines of code to make an arc. Note that I am using Visual Basic 05 and the TAO framework, so you will have to adapt them to your programming language.
Note that since gluQuadricDrawStyle is set to draw lines, I just set the inner and outer radius of the arc to the same value.

    Dim AHP As Tao.OpenGl.Glu.GLUquadric = gluNewQuadric()
    Glu.gluQuadricDrawStyle(AHP, Glu.GLU_LINE)

    Glu.gluPartialDisk(AHP, ArcRadius, ArcRadius, 50, 20, AngleValue, Sweepangle)