Algebric Problem in Pie Chart
Why? if im draw a Ellipse and get a point(x,y) in 50 sing parametric Equation of the ellipse and if im draw a Pie using Graphics::DrawPie function in 50 its not equal point?? Ellipse with Width=200 and Height=150 and DrawPie equal ellipse!!!! Why??
Parametric Equation:
x=A*cos(t)
y=B*sin(t) where t=Pi*Angle/180
A=Width/2=100 and B=Height/2=75
Example:
DrawPie(&pen,CenterX,CenterY,200,150,0,50);
x=CenterX+(100*cos(t));
y=CenterY+(75*sin(t));
DrawLine(&pen,CenterX,Point.CenterY,x,y);
This sample draw line in different point!!! why?
Im want get all corner Points (x,y) in DrawPie();
Thanks!!!
[692 byte] By [
malves] at [2007-11-20 1:01:37]

# 1 Re: Algebric Problem in Pie Chart
I think you should have x=CenterX + (100*cos(t));
y=CenterY + (75*sin(t));
DrawLine(&pen,CenterX,CenterY,x,y);
EoF at 2007-11-10 23:19:39 >

# 3 Re: Algebric Problem in Pie Chart
Well...for DrawPie(const Pen *pen, INT x, INT y, INT width, INT height, REAL startAngle, REAL sweepAngle) positive value for sweepAngle specifies clockwise rotation while sin and cos use trigonometric rotation. Also, note that the last parameter is sweepAngle, not EndAngle.
EoF at 2007-11-10 23:21:48 >
