Packagesekati.geom
Classpublic class Point
InheritancePoint Inheritance CoreObject
ImplementsIPoint
SubclassesPoint3D

Create a Point Object


Example
var p:Point = new sekati.geom.Point(10,10);



Public Properties
 PropertyDefined by
  x : Number
Point
  y : Number
Point
Public Methods
 MethodDefined by
  
Point(nX:Number = 0, nY:Number = 0)
Point Constructor
Point
  
Clone this Point.
Point
 Inherited
destroy():void
Clean and destroy object instance contents/self for garbage collection.
CoreObject
  
displace(nX:Number, nY:Number):Point
Returns a new point based on this point with x and y offset values
Point
  
Algo to give the grid based distance when only vertical & horizontal moves are allowed
Point
  
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
  
getAngle(p:Point):Number
Get the angle degree between this point and a second point.
Point
  
getDistance(p:Point):Number
get distance between two points
Point
  
isEqual(p:Point):Boolean
check if two points match
Point
  
offset(x:Number, y:Number):void
Offset the Point object by a specified amount.
Point
  
rotate(p:Point, angle:Number):void
Rotate this Point around another Point by the specified angle.
Point
 Inherited
toString():String
Return the Fully Qualified Class Name string representation of the instance object via sekati.reflect.Stringifier.
CoreObject
Property detail
xproperty
public var x:Number
yproperty 
public var y:Number
Constructor detail
Point()constructor
public function Point(nX:Number = 0, nY:Number = 0)

Point Constructor

Parameters
nX:Number (default = 0) — (Number)
 
nY:Number (default = 0) — (Number)
Method detail
clone()method
public function clone():Point

Clone this Point.

Returns
Point — Point
displace()method 
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
Point — Point
getAbsoluteGridDistance()method 
public function getAbsoluteGridDistance(p:Point):Number

Algo to give the grid based distance when only vertical & horizontal moves are allowed

Parameters
p:Point — (Point)

Returns
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

Parameters
p:Point — (Point)

Returns
Number — Number
getAngle()method 
public function getAngle(p:Point):Number

Get the angle degree between this point and a second point.

Parameters
p:Point — (Point)

Returns
Number — Number
getDistance()method 
public function getDistance(p:Point):Number

get distance between two points

Parameters
p:Point — (Point)

Returns
Number — Number
isEqual()method 
public function isEqual(p:Point):Boolean

check if two points match

Parameters
p:Point — (Point)

Returns
Boolean — Boolean
offset()method 
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
rotate()method 
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)