Create a Point Object
Example
var p:Point = new sekati.geom.Point(10,10);
public var x:Number
public var y:Number
public function Point(nX:Number = 0, nY:Number = 0)
Point Constructor
Parameters
| nX:Number (default = 0 ) — (Number)
|
|
| nY:Number (default = 0 ) — (Number)
|
public function clone():Point
Clone this Point.
Returns
public function displace(nX:Number, nY:Number):Point
Returns a new point based on this point with x and y offset values
Parameters
| nX:Number — (Number)
|
|
| nY:Number — (Number)
|
Returns
public function getAbsoluteGridDistance(p:Point):Number
Algo to give the grid based distance when only vertical & horizontal moves are allowed
Parameters
Returns
public function getAbsoluteGridDistanceAllowDiagonals(p:Point):Number
Algo to give the grid based distance when diagonal moves are allowed
by finding math.min of the differences, we're figuring out how many moves can be diagonal ones.
Then we can just substract that number from the normal .getAbsoluteGridDistance() method since diagonals take
1 move instead of the usual 2
Parameters
Returns
public function getAngle(p:Point):Number
Get the angle degree between this point and a second point.
Parameters
Returns
public function getDistance(p:Point):Number
get distance between two points
Parameters
Returns
public function isEqual(p:Point):Boolean
check if two points match
Parameters
Returns
public function offset(x:Number, y:Number):void
Offset the Point object by a specified amount.
Parameters
| x:Number — (Number) horizontal offset
|
|
| y:Number — (Number) vertical offset
|
public function rotate(p:Point, angle:Number):void
Rotate this Point around another Point by the specified angle.
Parameters
| p:Point — (Point)
|
|
| angle:Number — (Number)
|
Copyright © 2008-2012 jason m horwitz, Sekati LLC. All Rights Reserved.