A collection of utility functions for manipulating Point objects.
public static function angle(origin:Point, target:Point):Number
Calculates the angle between two points.
Parameters
| origin:Point — the first point
|
| |
| target:Point — the second point
|
Returns
| Number — the angle in radians
|
public static function dotProduct(u:Point, v:Point):Number
Calculates the dot product of two points.
Parameters
Returns
public static function reverse(v:Point):Point
Reverses a point around the origin. Same as a performing a scalar
multiplication of -1 on the point.
Parameters
| v:Point — The point to reverse. Does not alter this value.
|
Returns
| Point — The reversed point.
|
public static function rotate(u:Point, angleRadians:Number):Point
Rotates a point around the origin.
Parameters
| u:Point — The point to rotate.
|
| |
| angleRadians:Number — The angle at which to rotate (in radians).
|
Returns
| Point — The rotated point.
|
public static function scalarDivide(v:Point, s:Number):Point
Performs scalar division on a point.
Parameters
Returns
public static function scalarMultiply(v:Point, s:Number):Point
Performs scalar multiplication on a point.
Parameters
Returns
Copyright 2010 Josh Tynjala. All rights reserved.