Hello,
I am trying to make, Arc, Using GDI. There is a problem that I am facing while rendering Arc for the angles life, 90 to 91, 180 to 181, 270 to 271. Following is the code and output snapshot.

//CODE SEGMENT

...

// Create a geometric pen.

LOGBRUSH logBrush;
logBrush.lbStyle = BS_SOLID;
logBrush.lbColor = RGB(0,0,0);
CPen myPen2(PS_SOLID|PS_GEOMETRIC|PS_ENDCAP_SQUARE |PS_JOIN_MITER, 50, &logBrush);
pDC->SelectObject(&myPen2);

// First arc of 270 degree
pDC->Arc(100,100,300,300,200,100,100,200);//at angle 270

// second arc of 90 degree
pDC->MoveTo(450,400);
pDC->AngleArc(450, 400, 150, 0.0f, 90.0f);

...


Here is the output :

GDI - Issue while drawing Arc-correct_arcs-jpg



THIS OUTPUT IS CORRECT ... Follow the below small step to get the unexpected behaviour.

and when I change the angle the output is wiered. Check by changing the last parameter of first arc to 202 instead of 200. And change the angle, of second arc to 91.0f, to see the problem.
this is only happening for angles like, 91, 181, 271. I am not sure how this is happening, may be some quadrant related calculations are causing this. :S
Can anybody tell me how I can fix this issue ? Is this related to joints ? can you guide me what exactly is SetMiterLimit(...) does ?
Is this is API issue ?
Thanks in advance.
NJ