Public Constants
 ConstantDefined By
  acosD : Function
Returns the inverse cosine of a slope ratio and returns its angle in degrees.
core.maths
  acosHm : Function
Anti-hyperbolic cosine.
core.maths
  acosHp : Function
Anti-hyperbolic cosine.
core.maths
  angleOfLine : Function
Returns the angle in degrees between 2 points with this coordinates passed in argument.
core.maths
  asinD : Function
Calculates the arcsine of the passed angle.
core.maths
  asinH : Function
Anti-hyperbolic sine.
core.maths
  atan2D : Function
Calculates the arctangent2 of the passed angle.
core.maths
  atanD : Function
Calculates the arctangent of the passed angle.
core.maths
  atanH : Function
Anti-hyperbolic tangent.
core.maths
  berp : Function
Short for 'boing-like interpolation', this method will first overshoot, then waver back and forth around the end value before coming to a rest.
core.maths
  bounce : Function
Returns a value between 0 and 1 that can be used to easily make bouncing GUI items (a la OS X's Dock) Example : import core.maths.bounce ; trace( bounce( 0.5 ) ) ;
core.maths
  cartesianToPolar : Function
Converts a vector in cartesian in a polar vector.
core.maths
  ceil : Function
Rounds and returns the ceiling of the specified number or expression.
core.maths
  clamp : Function
Bounds a numeric value between 2 numbers.
core.maths
  clerp : Function
Circular Lerp is like lerp but handles the wraparound from 0 to 360.
core.maths
  cosD : Function
Calculates the cosine of the passed angle.
core.maths
  coserp : Function
Short for 'cosinusoidal interpolation', this method will interpolate while easing around the end, when value is near one.
core.maths
  cosH : Function
Hyperbolic cosine.
core.maths
  DEG2RAD : Number = 0.017453292519943295
This constant change degrees to radians : Math.PI/180.
core.maths
  degreesToRadians : Function
Converts an angle in degrees in radians
core.maths
  distance : Function
Returns the distance between 2 points with the coordinates of the 2 points.
core.maths
  distanceByObject : Function
Returns the distance between 2 points with the coordinates of the 2 points.
core.maths
  EPSILON : Number = 0.000000001
Represents the smallest positive Single value greater than zero.
core.maths
  fixAngle : Function
Fixs an angle in degrees between 0 and 360 degrees.
core.maths
  floor : Function
Rounds and returns a number by a count of floating points.
core.maths
  gcd : Function
Returns the greatest common divisor with the Euclidean algorithm.
core.maths
  hermite : Function
This method will interpolate while easing in and out at the limits.
core.maths
  hypothenuse : Function
Calculates the hypothenuse value of the two passed-in triangle sides value.
core.maths
  interpolate : Function
With a number value and a range this method returns the actual value for the interpolated value in that range.
core.maths
  isEven : Function
Indicates if an integer that is "evenly divisible" by 2.
core.maths
  isOdd : Function
Indicates if an integer that is not "evenly divisible" by 2.
core.maths
  LAMBDA : Number = 0.57721566490143
This constant is the Euler-Mascheroni constant (lambda or C) : ( n ) lim( sigma 1/k - ln(n) ) n->oo ( k=1 )
core.maths
  lerp : Function
Calculates a number between two numbers at a specific increment.
core.maths
  log10 : Function
Calculates the log10 of the specified value.
core.maths
  logN : Function
Calculates the logN of the specified value.
core.maths
  map : Function
Takes a value in a given range (minimum1, maximum1) and finds the corresponding value in the next range(minimum2, maximum2).
core.maths
  normalize : Function
Takes a value within a given range and converts it to a number between 0 and 1.
core.maths
  percentage : Function
Returns a percentage or null.
core.maths
  PHI : Number = 1.61803398874989
This constant is the golden ratio (phi) : ( 1 + Math.sqrt(5) ) / 2.
core.maths
  polarToCartesian : Function
Converts a Polar object in a cartesian vector.
core.maths
  RAD2DEG : Number = 57.29577951308232
This constant change radians to degrees : 180/Math.PI.
core.maths
  radiansToDegrees : Function
Converts an angle in radians in degrees
core.maths
  replaceNaN : Function
Replace the passed-in Number value, if the value is NaN the return value is the default value in second argument.
core.maths
  round : Function
Rounds and returns a number by a count of floating points.
core.maths
  sign : Function
Returns 1 if the value is positive or -1.
core.maths
  sinD : Function
Calculates the sine of the passed angle.
core.maths
  sinerp : Function
Short for 'sinusoidal interpolation', this method will interpolate while easing around the end, when value is near one.
core.maths
  sinH : Function
Hyperbolic sine.
core.maths
  tanD : Function
Calculates the tangent of the passed angle.
core.maths
  tanH : Function
Hyperbolic tangent.
core.maths
Constant Detail
DEG2RADConstant
public const DEG2RAD:Number = 0.017453292519943295

This constant change degrees to radians : Math.PI/180.

EPSILONConstant 
public const EPSILON:Number = 0.000000001

Represents the smallest positive Single value greater than zero.

LAMBDAConstant 
public const LAMBDA:Number = 0.57721566490143

This constant is the Euler-Mascheroni constant (lambda or C) :

    ( n )
    lim( sigma 1/k - ln(n) )
    n->oo ( k=1 )
    

PHIConstant 
public const PHI:Number = 1.61803398874989

This constant is the golden ratio (phi) : ( 1 + Math.sqrt(5) ) / 2.

RAD2DEGConstant 
public const RAD2DEG:Number = 57.29577951308232

This constant change radians to degrees : 180/Math.PI.

acosDConstant 
public const acosD:Function

Returns the inverse cosine of a slope ratio and returns its angle in degrees.

acosHmConstant 
public const acosHm:Function

Anti-hyperbolic cosine.

     acoshm = ln(x-√(x^2-1))
     

acosHpConstant 
public const acosHp:Function

Anti-hyperbolic cosine.

     acoshp = ln(x+√(x^2-1))
     

angleOfLineConstant 
public const angleOfLine:Function

Returns the angle in degrees between 2 points with this coordinates passed in argument.

asinDConstant 
public const asinD:Function

Calculates the arcsine of the passed angle.

asinHConstant 
public const asinH:Function

Anti-hyperbolic sine.

atan2DConstant 
public const atan2D:Function

Calculates the arctangent2 of the passed angle.

atanDConstant 
public const atanD:Function

Calculates the arctangent of the passed angle.

atanHConstant 
public const atanH:Function

Anti-hyperbolic tangent.

berpConstant 
public const berp:Function

Short for 'boing-like interpolation', this method will first overshoot, then waver back and forth around the end value before coming to a rest.

Example :

     import core.maths.berp ;
     trace( berp( 0 , 100 , 0.5 ) ; 
     

bounceConstant 
public const bounce:Function

Returns a value between 0 and 1 that can be used to easily make bouncing GUI items (a la OS X's Dock)

Example :

     import core.maths.bounce ;
     trace( bounce( 0.5 ) ) ; 
     

cartesianToPolarConstant 
public const cartesianToPolar:Function

Converts a vector in cartesian in a polar vector. Return a generic object with the properties angle and radius.

ceilConstant 
public const ceil:Function

Rounds and returns the ceiling of the specified number or expression. The ceiling of a number is the closest integer that is greater than or equal to the number.

Example :

     import core.maths.ceil ;
     
     var n:Number ;
     
     n = ceil(4.572525153, 2) ;
     trace ("n : " + n) ; // n : 4.58
     
     n = ceil(4.572525153, -1) ;
     trace ("n : " + n) ; // n : 5
     

clampConstant 
public const clamp:Function

Bounds a numeric value between 2 numbers.

Example :

     import core.maths.clamp ;
     
     var n:Number ;
     
     n = clamp(4, 5, 10) ;
     trace ("n : " + n) ; // 5
     
     n = clamp(12, 5, 10) ;
     trace ("n : " + n) ; // 10
     
     n = clamp(6, 5, 10) ;
     trace ("n : " + n) ; // 5
     
     var n = clamp(NaN, 5, 10) ;
     trace ("n : " + n) ; // NaN
     

clerpConstant 
public const clerp:Function

Circular Lerp is like lerp but handles the wraparound from 0 to 360. This is useful when interpolating eulerAngles and the object crosses the 0/360 boundary. The standard Lerp function causes the object to rotate in the wrong direction and looks stupid, clerp() fixes that.

Example :

     import core.maths.clerp ;
     trace( clerp( 0 , 180 , 0.5 ) ; // 90
     

cosDConstant 
public const cosD:Function

Calculates the cosine of the passed angle.

cosHConstant 
public const cosH:Function

Hyperbolic cosine.

coserpConstant 
public const coserp:Function

Short for 'cosinusoidal interpolation', this method will interpolate while easing around the end, when value is near one.

Example :

     import core.maths.coserp ;
     trace( coserp( 0 , 100 , 0.5 ) ;
     

degreesToRadiansConstant 
public const degreesToRadians:Function

Converts an angle in degrees in radians

distanceByObjectConstant 
public const distanceByObject:Function

Returns the distance between 2 points with the coordinates of the 2 points.

distanceConstant 
public const distance:Function

Returns the distance between 2 points with the coordinates of the 2 points.

fixAngleConstant 
public const fixAngle:Function

Fixs an angle in degrees between 0 and 360 degrees.

floorConstant 
public const floor:Function

Rounds and returns a number by a count of floating points.

Example :

     import core.maths.floor ;
     
     var n:Number ;
     
     n = floor(4.572525153, 2) ;
     trace ("n : " + n) ; // n : 4.57
     
     n = floor(4.572525153, -1) ;
     trace ("n : " + n) ; // n : 4
     

gcdConstant 
public const gcd:Function

Returns the greatest common divisor with the Euclidean algorithm.

Example :

     import core.maths.gcd ;
     
     trace("gcd(320,240) : " + gcd(320,240) ) ; // gcd(320,240) : 80
     

hermiteConstant 
public const hermite:Function

This method will interpolate while easing in and out at the limits.

Example :

     import core.maths.hermite ;
     trace( hermite( 0 , 100 , 0.5 ) ; // 50
     

hypothenuseConstant 
public const hypothenuse:Function

Calculates the hypothenuse value of the two passed-in triangle sides value.

A hypotenuse is the longest side of a right triangle (Right-angled triangle in British English), the side opposite the right angle. The length of the hypotenuse of a right triangle can be found using the Pythagorean theorem, which states that the square of the length of the hypotenuse equals the sum of the squares of the lengths of the other two sides.

interpolateConstant 
public const interpolate:Function

With a number value and a range this method returns the actual value for the interpolated value in that range.

     import core.maths.interpolate ;
     
     trace( interpolate( 0.5, 0 , 100 ) ) ; // 50
     

isEvenConstant 
public const isEven:Function

Indicates if an integer that is "evenly divisible" by 2.

isOddConstant 
public const isOdd:Function

Indicates if an integer that is not "evenly divisible" by 2.

lerpConstant 
public const lerp:Function

Calculates a number between two numbers at a specific increment. The lerp function is convenient for creating motion along a straight path and for drawing dotted lines.

Lerp is an abbreviation for linear interpolation, which can also be used as a verb (Raymond 2003).

Linear interpolation is a method of curve fitting using linear polynomials. It is heavily employed in mathematics (particularly numerical analysis), and numerous applications including computer graphics. It is a simple form of interpolation.

Example :

     import core.maths.lerp ;
     trace( lerp( 0 , 100 , 0.5 ) ; // 50
     

log10Constant 
public const log10:Function

Calculates the log10 of the specified value.

logNConstant 
public const logN:Function

Calculates the logN of the specified value.

mapConstant 
public const map:Function

Takes a value in a given range (minimum1, maximum1) and finds the corresponding value in the next range(minimum2, maximum2).

     import core.maths.map ;
     
     trace( map( 10,  0, 100, 20, 80  ) ) ; // 26
     trace( map( 26, 20,  80,  0, 100 ) ) ; // 10
     

normalizeConstant 
public const normalize:Function

Takes a value within a given range and converts it to a number between 0 and 1. Actually it can be outside that range if the original value is outside its range.

     import core.maths.normalize ;
     
     trace( normalize( 10, 0 , 100 ) ) ; // 0.1
     

percentageConstant 
public const percentage:Function

Returns a percentage or null.

Example :

     import core.maths.percentage ;
     
     trace( percentage( 50 , 100 ) + "%" ) ; // 50%
     trace( percentage( 68 , 425 ) + "%" ) ; // 16% 
     

polarToCartesianConstant 
public const polarToCartesian:Function

Converts a Polar object in a cartesian vector.

radiansToDegreesConstant 
public const radiansToDegrees:Function

Converts an angle in radians in degrees

replaceNaNConstant 
public const replaceNaN:Function

Replace the passed-in Number value, if the value is NaN the return value is the default value in second argument.

roundConstant 
public const round:Function

Rounds and returns a number by a count of floating points.

Example :

     import core.maths.round ;
     
     var n:Number ;
     
     n = round(4.572525153, 2) ;
     trace ("n : " + n) ; // 4.57
     
     var n = round(4.572525153, -1) ;
     trace ("n : " + n) ; // 5
     

signConstant 
public const sign:Function

Returns 1 if the value is positive or -1.

Example :

     import core.maths.sign ;
     
     var n:int ;
     
     n = sign(-150) ;
     trace ("n : " + n) ; // -1
     
     n = sign(200) ;
     trace ("n : " + n) ; // 1
     
     n = sign(0) ;
     trace ("n : " + n) ; // 1
     


Throws
RangeError — if the passed-in value is NaN.
sinDConstant 
public const sinD:Function

Calculates the sine of the passed angle.

sinHConstant 
public const sinH:Function

Hyperbolic sine.

sinerpConstant 
public const sinerp:Function

Short for 'sinusoidal interpolation', this method will interpolate while easing around the end, when value is near one.

Example :

     import core.maths.sinerp ;
     trace( sinerp( 0 , 100 , 0.5 ) ;
     

tanDConstant 
public const tanD:Function

Calculates the tangent of the passed angle.

tanHConstant 
public const tanH:Function

Hyperbolic tangent.