IPoint Create a Point Object
Usage: var Point = new com.sekati.geom.Point(10,10);
new Point()public function isEqual(p:Point):Booleancheck if two points match
p | (Point) |
Boolean
public function getDistance(p:Point):Numberget distance between two points
p | (Point) |
Number
public function getAbsoluteGridDistance(p:Point):NumberAlgo to give the grid based distance when only vertical & horizontal moves are allowed
p | (Point) |
Number
public function getAbsoluteGridDistanceAllowDiagonals(p:Point):NumberAlgo 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
p | (Point) |
Number
public function getAngle(p:Point):NumberGet the angle degree between this point and a second point.
p | (Point) |
Number
public function displace(nX:Number, nY:Number):PointReturns a new point based on this point with x and y offset values
nX | (Number) |
nY | (Number) |
Point
public function offset(x:Number, y:Number):VoidOffset the Point object by a specified amount.
x | (Number) horizontal offset |
y | (Number) vertical offset |
Void
public function rotate(p:Point, angle:Number):VoidRotate this Point around another Point by the specified angle.
p | (Point) |
angle | (Number) |
Void