The Polar class converts between polar and cartesian coordinate systems.
ActionScript 2.0; Flash Player 6
Method summary
Method | Description |
---|---|
cartesianToPolar(x:Number, y:Number) : Object |
Converts a point from cartesian to polar coordinates. |
cartesianToPolarPts(p:Object) : Object |
Converts a point from cartesian to polar coordinates. |
polarToCartesian(r:Number, t:Number) : Object |
Converts a point from polar to cartesian coordinates. |
polarToCartesianPts(p:Object) : Object |
Converts a point from polar to cartesian coordinates. |
var polarPoint:Object = Polar.cartesianToPolar (3, 4);
trace (polarPoint.r);
trace (polarPoint.t);
x:Number
- The x value of the point.
y:Number
- The y value of the point.
Returns the radius and theta of the point in a point object.
Converts a point from cartesian to polar coordinates.
var cartesianPoint:Object = {x:3, y:4};
var polarPoint:Object = Polar.cartesianToPolarPts (cartesianPoint);
trace (polarPoint.r);
trace (polarPoint.t);
p:Object
- The point, with x and y properties, to convert.
Returns the radius and theta of the point in a point object.
Converts a point from cartesian to polar coordinates.
var cartesianPoint:Object = Polar.polarToCartesian (5, 90);
trace (cartesianPoint.x);
trace (cartesianPoint.y);
r:Number
- The radius of the point.
t:Number
- The theta of the point.
Returns the x and y values of the point in a point object.
Converts a point from polar to cartesian coordinates.
var polarPoint:Object = {r:5, t:90};
var cartesianPoint:Object = Polar.polarToCartesianPts (polarPoint);
trace (cartesianPoint.x);
trace (cartesianPoint.y);
p:Object
- The point, with r and t properties, to convert.
Returns the x and y values of the point in a point object.
Converts a point from polar to cartesian coordinates.