Packageorg.un.flex.utils
Classpublic class Geometry

This is a class to provide some static functions to help with angles and geometry.



Public Methods
 MethodDefined by
  
arcosh(x:Number):Number
[static] Returns inverse of the sine hyperbolic function: arcosh(x) = ln(x+sqrt(x^2-1)).
Geometry
  
arsinh(x:Number):Number
[static] Returns inverse of the sine hyperbolic function: arsinh(x) = ln(x+sqrt(x^2+1)).
Geometry
  
cartFromPolar(r:Number, a:Number):Point
[static] Calculate cartesian coordinates from polar coordinates, again this uses the polar method from the Point class, here for completeness.
Geometry
  
cartFromPolarDeg(r:Number, a:Number):Point
[static] Calculate cartesian coordinates from polar coordinates, again this uses the polar method from the Point class, here for completeness.
Geometry
  
cosh(x:Number):Number
[static] Returns cosine hyperbolic function: cosh(x) = 0.5e^x+e^(-x)).
Geometry
  
deg2rad(a:Number):Number
[static] Turns an angle given in degrees into radians.
Geometry
  
normaliseAngle(a:Number):Number
[static] Normalizes angles to be within the range of 0 to 2I by adding or subtracting 2 PI until the angle is within the range.
Geometry
  
normaliseAngleDeg(a:Number):Number
[static] Normalizes angles to be within the range of 0 to 360 by adding or subtracting 360 until the angle is within the range.
Geometry
  
polarAngle(p:Point):Number
[static] Calculate the polar Angle of a Point.
Geometry
  
polarAngleDeg(p:Point):Number
[static] Calculate the polar Angle of a Point in degrees.
Geometry
  
polarRadius(p:Point):Number
[static] Calculate the polar radius for a given point.
Geometry
  
rad2deg(a:Number):Number
[static] Turns an angle given in radians into degrees
Geometry
  
sinh(x:Number):Number
[static] Returns sine hyperbolic function: sinh(x) = 0.5e^x-e^(-x)).
Geometry
Method detail
arcosh()method
public static function arcosh(x:Number):Number

Returns inverse of the sine hyperbolic function: arcosh(x) = ln(x+sqrt(x^2-1)).

Parameters
x:Number

Returns
Number
arsinh()method 
public static function arsinh(x:Number):Number

Returns inverse of the sine hyperbolic function: arsinh(x) = ln(x+sqrt(x^2+1)).

Parameters
x:Number

Returns
Number
cartFromPolar()method 
public static function cartFromPolar(r:Number, a:Number):Point

Calculate cartesian coordinates from polar coordinates, again this uses the polar method from the Point class, here for completeness.

Parameters
r:Number — The polar radius.
 
a:Number — The polar angle in radians.

Returns
Point — A Point object with the cartesian coordinates.

See also

Point.polar()
cartFromPolarDeg()method 
public static function cartFromPolarDeg(r:Number, a:Number):Point

Calculate cartesian coordinates from polar coordinates, again this uses the polar method from the Point class, here for completeness.

Parameters
r:Number — The polar radius.
 
a:Number — The polar angle in degrees.

Returns
Point — A Point object with the cartesian coordinates.

See also

Point.polar()
cosh()method 
public static function cosh(x:Number):Number

Returns cosine hyperbolic function: cosh(x) = 0.5e^x+e^(-x)).

Parameters
x:Number

Returns
Number
deg2rad()method 
public static function deg2rad(a:Number):Number

Turns an angle given in degrees into radians.

Parameters
a:Number — The angle given in degrees.

Returns
Number — The angle in radians.
normaliseAngle()method 
public static function normaliseAngle(a:Number):Number

Normalizes angles to be within the range of 0 to 2I by adding or subtracting 2 PI until the angle is within the range.

Parameters
a:Number — The angle to normalise in radians.

Returns
Number — The normalized angle.
normaliseAngleDeg()method 
public static function normaliseAngleDeg(a:Number):Number

Normalizes angles to be within the range of 0 to 360 by adding or subtracting 360 until the angle is within the range.

Parameters
a:Number — The angle to normalise in degrees.

Returns
Number — The normalized angle.
polarAngle()method 
public static function polarAngle(p:Point):Number

Calculate the polar Angle of a Point.

Parameters
p:Point — The Point to which the Angle is needed.

Returns
Number — The polar angle in radians. The range is from 0 to 2 PI. Returns 0 for the origin.
polarAngleDeg()method 
public static function polarAngleDeg(p:Point):Number

Calculate the polar Angle of a Point in degrees.

Parameters
p:Point — The Point to which the Angle is needed.

Returns
Number — The polar angle in degrees. The range is from 0 to 360. Returns 0 for the origin.
polarRadius()method 
public static function polarRadius(p:Point):Number

Calculate the polar radius for a given point. This just calles the length method of the Point object, which is the same. It is part of this class for consistency.

Parameters
p:Point — The point to receive the polar radius from.

Returns
Number — The polar radius.

See also

Point.length
rad2deg()method 
public static function rad2deg(a:Number):Number

Turns an angle given in radians into degrees

Parameters
a:Number — The angle given in radians.

Returns
Number — The angle in degrees.
sinh()method 
public static function sinh(x:Number):Number

Returns sine hyperbolic function: sinh(x) = 0.5e^x-e^(-x)).

Parameters
x:Number

Returns
Number