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