flexlib :: library Documentation | All Packages | All Classes | Index | Frames No Frames |
GeomUtils

Package | flexlib.charts.utils
Class | public class GeomUtils
Inheritance | GeomUtils Object

This utility is used to help with geometry. All angles are specified in Radians.

Public Methods

| Method | Defined By
--- | --- | ---
|  | GeomUtils() | GeomUtils
|  | angleBetween(angle:Number, min:Number, max:Number):Boolean [static] This function is used to determine if the angle passed in is between the min and the max. | GeomUtils
|  | calcAngle(a:Point, b:Point):Number [static] This function calculates the angle between two points. | GeomUtils
|  | calcPoint(center:Point, angle:Number, radius:Number):Point [static] This function calculates the point specified as a function of the center point an angle and the circles radius | GeomUtils
|  | drawArc(graphics:Graphics, a:Point, radius:Number, startAngle:Number, endAngle:Number):void [static] This function draws a smooth arc between the start and end angle starting at the specified point | GeomUtils
|  | getNextLargestAngle(angle:Number, angles:Array):Number [static] This function is used to get the angle closest to the specified angle which is larger then the specified angle from the list of angles passed in. | GeomUtils
|  | getNextSmallestAngle(angle:Number, angles:Array):Number [static] This function is used to get the angle closest to the specified angle which is smaller then the specified angle from the list of angles passed in. | GeomUtils
|  | windDownAngle(angle:Number):Number [static] This function takes any angle greater then 360 degrees and winds it down to be between 0 and 360 degrees | GeomUtils

Public Constants

| Constant | Defined By
--- | --- | ---
|  | DEG_TO_RAD : Number = 57.2957795 [static] The number of degrees in a radian | GeomUtils

Constructor Detail

GeomUtils | () | Constructor

`public function GeomUtils()`

Method Detail

angleBetween | () | method

`public static function angleBetween(angle:Number, min:Number, max:Number):Boolean`

This function is used to determine if the angle passed in is between the min and the max.

Parameters

| `angle:Number` — The angle to use as a benchmark
| `min:Number` — The smaller angle
| `max:Number` — The larger angle

Returns

| `Boolean`

calcAngle | () | method |

`public static function calcAngle(a:Point, b:Point):Number`

This function calculates the angle between two points.

Parameters

| `a:Point` — The first point
| `b:Point` — The second point

Returns

| `Number` — The angle

calcPoint | () | method |

`public static function calcPoint(center:Point, angle:Number, radius:Number):Point`

This function calculates the point specified as a function of the center point an angle and the circles radius

Parameters

| `center:Point` — The center of the circle
| `angle:Number` — The angle which the point lays on
| `radius:Number` — The distance from the center that the point is

Returns

| `Point` — The point which fits the parameters

drawArc | () | method |

`public static function drawArc(graphics:Graphics, a:Point, radius:Number, startAngle:Number, endAngle:Number):void`

This function draws a smooth arc between the start and end angle starting at the specified point

Parameters

| `graphics:Graphics` — The graphics to draw into
| `a:Point` — The start point of the angle
| `radius:Number` — The radius of the arc
| `startAngle:Number` — The angle to start at
| `endAngle:Number` — The angle to stop at

getNextLargestAngle | () | method |

`public static function getNextLargestAngle(angle:Number, angles:Array):Number`

This function is used to get the angle closest to the specified angle which is larger then the specified angle from the list of angles passed in.

Parameters

| `angle:Number` — The angle to use as a benchmark
| `angles:Array` — The angles to search through

Returns

| `Number`

getNextSmallestAngle | () | method |

`public static function getNextSmallestAngle(angle:Number, angles:Array):Number`

This function is used to get the angle closest to the specified angle which is smaller then the specified angle from the list of angles passed in.

Parameters

| `angle:Number` — The angle to use as a benchmark
| `angles:Array` — The angles to search through

Returns

| `Number`

windDownAngle | () | method |

`public static function windDownAngle(angle:Number):Number`

This function takes any angle greater then 360 degrees and winds it down to be between 0 and 360 degrees

Parameters

| `angle:Number` — The angle to reduce

Returns

| `Number`

Constant Detail

DEG_TO_RAD | Constant

`public static const DEG_TO_RAD:Number = 57.2957795`

The number of degrees in a radian

Dimanche Juin 19 2011, 03:12 PM +02:00