| Package | net.dmclaren.utils |
| Class | public class GeomUtils |
flash.geom package.
| Method | Defined by | ||
|---|---|---|---|
|
getAngleBetweenPoints(point0:Point, point1:Point):Number
[static]
Gives the shortest angle between two given Points.
| GeomUtils | ||
|
getDotProduct(point0:Point, point1:Point):Number
[static]
Gives the dot product of the two given Points.
| GeomUtils | ||
|
getLineCircleIntersections(x1:Number, y1:Number, x2:Number, y2:Number, r:Number):Array
[static]
Fetches any intersection points between the given line and circle.
| GeomUtils | ||
|
getPointAngle(point:Point, flipYAxis:Boolean = false):Number
[static]
Gives the angle of the given Point.
| GeomUtils | ||
|
getPointProjection(vector:Point, ontoVector:Point):Point
[static]
Projects one Point vector onto a unit vector Point.
| GeomUtils | ||
|
rotatePoint(point:Point, angle:Number):Point
[static]
Rotates the given Point by the given angle and returns it.
| GeomUtils | ||
|
scalePoint(point:Point, scale:Number):Point
[static]
Scales the given Point by the given factor and returns it.
| GeomUtils | ||
| getAngleBetweenPoints | () | method |
public static function getAngleBetweenPoints(point0:Point, point1:Point):NumberGives the shortest angle between two given Points.
Parameterspoint0:Point |
|
point1:Point |
Number |
| getDotProduct | () | method |
public static function getDotProduct(point0:Point, point1:Point):NumberGives the dot product of the two given Points.
Parameterspoint0:Point |
|
point1:Point |
Number |
| getLineCircleIntersections | () | method |
public static function getLineCircleIntersections(x1:Number, y1:Number, x2:Number, y2:Number, r:Number):ArrayFetches any intersection points between the given line and circle. The line is defined by two points and the circle is centered at (0, 0). The return value may be an empty array (no intersections), an array with one Point (tangent), or an array with two Points (two intersections).
If there are two intersections, the first will add the discriminant root and the second will subtract it. This ordering is gauranteed.
Thanks to MathWorld.
Parametersx1:Number — The X-coordinate of the first point on the line.
|
|
y1:Number — The Y-coordinate of the first point on the line.
|
|
x2:Number — The X-coordinate of the second point on the line.
|
|
y2:Number — The Y-coordinate of the second point on the line.
|
|
r:Number — The radius of the circle.
|
Array — An array containing, zero, one, or two intersections as Points.
|
See also
| getPointAngle | () | method |
public static function getPointAngle(point:Point, flipYAxis:Boolean = false):NumberGives the angle of the given Point.
Parameterspoint:Point |
|
flipYAxis:Boolean (default = false) |
Number |
| getPointProjection | () | method |
public static function getPointProjection(vector:Point, ontoVector:Point):PointProjects one Point vector onto a unit vector Point.
Parametersvector:Point |
|
ontoVector:Point |
Point |
| rotatePoint | () | method |
public static function rotatePoint(point:Point, angle:Number):Point
Rotates the given Point by the given angle and returns it. Note that
this method modifies the given Point and does not create a new
instance. If you don't want to modify the given point, use
Point.clone().
point:Point |
|
angle:Number |
Point |
| scalePoint | () | method |
public static function scalePoint(point:Point, scale:Number):Point
Scales the given Point by the given factor and returns it. Note that
this method modifies the given Point and does not create a new
instance. If you don't want to modify the given point, use
Point.clone().
point:Point |
|
scale:Number |
Point |