Point
Point in 2D space
Constructor Summary
Public Constructor | ||
public |
constructor(x: *, y: *, tag: *) Make new point. |
Method Summary
Public Methods | ||
public |
clone(): misc.Point Clone the point |
|
public |
Check if points are equal |
|
public |
getDistance(point: *): number Calculate Euclidean distance between two Points |
|
public |
Return x coordinate |
|
public |
Returns y coordinate |
|
public |
rotate(originPoint: *, angleDegrees: *): misc.Point Rotate point around origin point |
|
public |
rotateAroundZero(angleDegrees: *): misc.Point Optimized algorithm for point rotation around coordinate beginning |
|
public |
setX(x: *): * Set X coordinate |
|
public |
setY(y: *): * Set Y coordinate |
|
public |
translate(translatePoint: *): * Translate point |
Public Constructors
public constructor(x: *, y: *, tag: *) source
Make new point.
Params:
Name | Type | Attribute | Description |
x | * | {number} - x coordinate |
|
y | * | {number} - y coordinate |
|
tag | * | {string} - Option parameter. It is used to determine to which table point belongs. |
Public Methods
public equals(point: *): boolean source
Check if points are equal
Params:
Name | Type | Attribute | Description |
point | * | {Point} - Another point to be compared |
public getDistance(point: *): number source
Calculate Euclidean distance between two Points
Params:
Name | Type | Attribute | Description |
point | * | {misc.Point} - Another point to compare with |
public rotate(originPoint: *, angleDegrees: *): misc.Point source
Rotate point around origin point
Params:
Name | Type | Attribute | Description |
originPoint | * | {misc.Point} - Origin point |
|
angleDegrees | * | {Number} - Rotation angle |
Return:
misc.Point |
public rotateAroundZero(angleDegrees: *): misc.Point source
Optimized algorithm for point rotation around coordinate beginning
Params:
Name | Type | Attribute | Description |
angleDegrees | * | {Number} |
Return:
misc.Point |
public setX(x: *): * source
Set X coordinate
Params:
Name | Type | Attribute | Description |
x | * | {number} - X coordinate |
Return:
* |
public setY(y: *): * source
Set Y coordinate
Params:
Name | Type | Attribute | Description |
y | * | {number} - Y coordinate |
Return:
* |
public translate(translatePoint: *): * source
Translate point
Params:
Name | Type | Attribute | Description |
translatePoint | * | x and y parameters for translation |
Return:
* |