Packagecom.adobe.portfolio.utils
Classpublic class MathUtil
InheritanceMathUtil Inheritance Object

Language Version : ActionScript 3.0
Product Version : Portfolio 10.0
Runtime Versions : Flash Player 10.1, AIR 2.0

The MathUtil class is a set of math utility functions.



Public Methods
 MethodDefined By
  
clipToRange(value:Number, min:Number, max:Number):Number
[static] Clips an input value to the specified range.
MathUtil
  
fitSize(size:Point, maxWidth:Number, maxHeight:Number):Point
[static] Returns the dimensions that will fit within the specified maximum width and height.
MathUtil
  
projectedBounds(bounds:Rectangle, matrix:Matrix3D, projection:PerspectiveProjection):Rectangle
[static] Returns the projected bounds of a rectangle given a matrix and a perspective projecion.
MathUtil
Method Detail
clipToRange()method
public static function clipToRange(value:Number, min:Number, max:Number):Number

Language Version : ActionScript 3.0
Product Version : Portfolio 10.0
Runtime Versions : Flash Player 10.1, AIR 2.0

Clips an input value to the specified range.

Parameters

value:Number — the input value to be clipped
 
min:Number — the minimum value
 
max:Number — the maximum value

Returns
Number — a value clipped to the range [min, max] (inclusive)
fitSize()method 
public static function fitSize(size:Point, maxWidth:Number, maxHeight:Number):Point

Language Version : ActionScript 3.0
Product Version : Portfolio 10.0
Runtime Versions : Flash Player 10.1, AIR 2.0

Returns the dimensions that will fit within the specified maximum width and height. The dimensions will have the same aspect ratio as the input dimensions (the size parameter)

Parameters

size:Point — a Point that contains the input dimensions
 
maxWidth:Number — the maximum width of the output
 
maxHeight:Number — the maximum height of the output

Returns
Point — a Point that contains the largest dimensions that satisfy the constraint
projectedBounds()method 
public static function projectedBounds(bounds:Rectangle, matrix:Matrix3D, projection:PerspectiveProjection):Rectangle

Language Version : ActionScript 3.0
Product Version : Portfolio 10.0
Runtime Versions : Flash Player 10.1, AIR 2.0

Returns the projected bounds of a rectangle given a matrix and a perspective projecion.

Parameters

bounds:Rectangle — The rectangle
 
matrix:Matrix3D — The matrix
 
projection:PerspectiveProjection — The projection

Returns
Rectangle — The projected bounds of the specified rectangle