Package | sekati.geom |
Class | public class Point |
Inheritance | Point CoreObject |
Implements | IPoint |
Subclasses | Point3D |
Method | Defined by | ||
---|---|---|---|
Point(nX:Number = 0, nY:Number = 0)
Point Constructor
| Point | ||
Clone this Point.
| Point | ||
destroy():void
Clean and destroy object instance contents/self for garbage collection.
| CoreObject | ||
Returns a new point based on this point with x and y offset values
| Point | ||
getAbsoluteGridDistance(p:Point):Number
Algo to give the grid based distance when only vertical & horizontal moves are allowed
| Point | ||
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.
| Point | ||
Get the angle degree between this point and a second point.
| Point | ||
getDistance(p:Point):Number
get distance between two points
| Point | ||
check if two points match
| Point | ||
offset(x:Number, y:Number):void
Offset the Point object by a specified amount.
| Point | ||
Rotate this Point around another Point by the specified angle.
| Point | ||
toString():String
Return the Fully Qualified Class Name string representation of
the instance object via
sekati.reflect.Stringifier . | CoreObject |
x | property |
public var x:Number
y | property |
public var y:Number
Point | () | constructor |
public function Point(nX:Number = 0, nY:Number = 0)
Point Constructor
ParametersnX:Number (default = 0 ) — (Number)
|
|
nY:Number (default = 0 ) — (Number)
|
clone | () | method |
displace | () | method |
public function displace(nX:Number, nY:Number):Point
Returns a new point based on this point with x and y offset values
ParametersnX:Number — (Number)
|
|
nY:Number — (Number)
|
Point —
Point
|
getAbsoluteGridDistance | () | method |
public function getAbsoluteGridDistance(p:Point):Number
Algo to give the grid based distance when only vertical & horizontal moves are allowed
Parametersp:Point — (Point)
|
Number — Number
|
getAbsoluteGridDistanceAllowDiagonals | () | method |
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
Parametersp:Point — (Point)
|
Number — Number
|
getAngle | () | method |
public function getAngle(p:Point):Number
Get the angle degree between this point and a second point.
Parametersp:Point — (Point)
|
Number — Number
|
getDistance | () | method |
public function getDistance(p:Point):Number
get distance between two points
Parametersp:Point — (Point)
|
Number — Number
|
isEqual | () | method |
public function isEqual(p:Point):Boolean
check if two points match
Parametersp:Point — (Point)
|
Boolean — Boolean
|
offset | () | method |
public function offset(x:Number, y:Number):void
Offset the Point object by a specified amount.
Parametersx:Number — (Number) horizontal offset
|
|
y:Number — (Number) vertical offset
|
rotate | () | method |
public function rotate(p:Point, angle:Number):void
Rotate this Point around another Point by the specified angle.
Parametersp:Point — (Point)
|
|
angle:Number — (Number)
|