Hi,
I want to draw lines from centre of circle to its boundary. First I want to draw lines on one half of the circle. I am using Ellipse function for drawing circle in VC++ which draws a square of diagonal (x1, y1) and (x2, y2).
Some body plz guide me with this problem.
Zulfi.
I want to draw lines from centre of circle to its boundary. First I want to draw lines on one half of the circle. I am using Ellipse function for drawing circle in VC++ which draws a square of diagonal (x1, y1) and (x2, y2).
Rich (BB code):
#define RADEG 57.29577951
#define Cos(a) (cos((a)/RADEG))
#define Sin(a) (sin((a)/RADEG))
int x1, y1, x2, y2, i, r, old_xc,old_yc, x,y;
int xc, yc;
x1=170;
y1=300;
x2=70;
y2=400;
pDC->Ellipse(x1,y1,x2,y2);
r= (y2-y1)/2;
old_xc=xc=x2+r;
old_yc=yc=y1+r;
int Angle=360;
x1 = (r) * Cos(Angle) ;
y1 = (r) * Sin(Angle) ;
for(i=0; i<50; ++i) {
x2 = (xc) + ((x1 * Cos(Angle) - y1 * Sin(Angle)));
y2 = (yc) + ((x1 * Sin(Angle) + y1 * Cos(Angle)));
pDC->MoveTo(old_xc, old_yc);
pDC->LineTo(x2,y2);
x1=x2;
y1=y2;
}
Zulfi.