How does AngleToPos work?

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
Bill
Newbie
Newbie
Posts: 21
Joined: Mon Jan 03, 2011 12:00 am

How does AngleToPos work?

Post by Bill » Wed Jul 20, 2011 2:54 pm

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

Yeray
Site Admin
Site Admin
Posts: 9612
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: How does AngleToPos work?

Post by Yeray » Fri Jul 22, 2011 9:49 am

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);
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Post Reply