Point
Extends:
Point class
Example:
var point = new KQ.Struct.Point(200, 300);
Constructor Summary
| Public Constructor | ||
| public |
constructor(x: Number, y: Number, isRound: Boolean) Constructor |
|
Method Summary
| Public Methods | ||
| public |
Returns the result of addition of the current and the given points |
|
| public |
Returns a copy of the current point with ceiled coordinates (rounded up) |
|
| public |
distanceTo(point: Point): Number Returns the cartesian distance between the current and the given points |
|
| public |
Returns the result of division of the current point by the given number |
|
| public |
Returns true if the given point has the same coordinates |
|
| public |
Returns a copy of the current point with floored coordinates (rounded down) |
|
| public |
multiplyBy(num: Number): Point Returns the result of multiplication of the current point by the given number |
|
| public |
Returns a copy of the current point with rounded coordinates |
|
| public |
Returns the result of subtraction of the given point from the current |
|
| public |
Returns a string representation of the point for debugging purposes |
|
Public Constructors
Public Methods
public add(point: Point): Point source
Returns the result of addition of the current and the given points
Params:
| Name | Type | Attribute | Description |
| point | Point | point object |
public ceil(): Point source
Returns a copy of the current point with ceiled coordinates (rounded up)
public distanceTo(point: Point): Number source
Returns the cartesian distance between the current and the given points
Params:
| Name | Type | Attribute | Description |
| point | Point | another point |
public divideBy(num: Number): Point source
Returns the result of division of the current point by the given number
Params:
| Name | Type | Attribute | Description |
| num | Number | divisor |
public equals(point: Point): Boolean source
Returns true if the given point has the same coordinates
Params:
| Name | Type | Attribute | Description |
| point | Point | another point |
public floor(): Point source
Returns a copy of the current point with floored coordinates (rounded down)
public multiplyBy(num: Number): Point source
Returns the result of multiplication of the current point by the given number
Params:
| Name | Type | Attribute | Description |
| num | Number | multiplier |
Reference
Source