PointUtils

Kind of class:class
Inherits from:none
Classpath:org.asapframework.util.PointUtils
File last modified:Sunday, 08 October 2006, 10:08:09
Point utility methods.

Summary


Class methods
  • multiply (inPoint:Point, inFactor:Number) : Point
    • Mutliplies the coordinates of the given Point and creates a new Point with the result.
  • average (a:Point) : Point
    • Calculates the average of two points and creates a new Point with the result.

Class methods

average

static function average (
a:Point, b:Point) : Point

Calculates the average of two points and creates a new Point with the result.
Parameters:
a:
the first Point
b:
the second Point
Returns:
  • A new Point with the average of Point a and Point b.

multiply

static function multiply (
inPoint:Point, inFactor:Number) : Point

Mutliplies the coordinates of the given Point and creates a new Point with the result.
Parameters:
inPoint :
the Point to multiply
inFactor:
the multiply factor
Returns:
  • The new Point.
Usage:
  • var point:Point = new Point(100,200);
    var newPoint:Point = PointUtils.multiply(point, 0.5); // (50,100)