Page 1 of 1

How does AngleToPos work?

Posted: Wed Jul 20, 2011 2:54 pm
by 16558319
Hi,

I'm trying to use the function AngleToPos in a PolarSeries. The resulting X, Y value gives me the right angle, but the radius is off for some reason.

Series1->AddPolar(10, 50);
Series1->AddPolar(20, 50);

int ax = Series1->CalcXPos(0);
int ay = Series1->CalcYPos(0);

This function gives me the right X, Y value. However, if I use

Series1->AngleToPos(10 * pi / 180, 50, 50, X, Y);

The radius I get from the X, Y values is way off.

Is there a scale of some sort that I need to use to convert the radius?

Thanks.

-Bill

Re: How does AngleToPos work?

Posted: Fri Jul 22, 2011 9:49 am
by yeray
Hello Bill,

As the help descritpion for the AngleToPos function says:
help wrote:Description
The AngleToPos functions returns the exact Screen position for a given pair of Angle and Radius values.

Angles must be expressed in radians from 0 to 2*PI. Radius parameter is in number of pixels.
So you should proceed as follows:

Code: Select all

Series1.AngleToPos(10 * pi / 180, Chart1.Axes.Bottom.CalcSizeValue(50), Chart1.Axes.Left.CalcSizeValue(50), ax, ay);