Class: Point
Common.Point(x, y, zopt, wopt)
Represents point geometry
Constructor
new Point(x, y, zopt, wopt)
Creates a point
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
x | float | The point's horizontal coordinate | |
y | float | The point's vertical coordinate | |
z | float | <optional> | The point's depth coordinate |
w | float | <optional> | The point's perspective value |
Methods
abs() → Common.Point
Absolute point. The original point is not altered.
Returns:
Transform as new Point
Type
absSelf() → Common.Point
Absolute point
Returns:
Current point
Type
add(point) → Common.Point
Applys addition. The original point is not altered.
Parameters:
Name | Type | Description |
---|---|---|
point | Common.Point |
Returns:
Transform as new Point
Type
addSelf(point) → Common.Point
Applys addition
Parameters:
Name | Type | Description |
---|---|---|
point | Common.Point |
Returns:
Current point
Type
divide(point) → Common.Point
Applys division. The original point is not altered.
Parameters:
Name | Type | Description |
---|---|---|
point | Common.Point |
Returns:
Transform as new Point
Type
divideSelf(point) → Common.Point
Applys division
Parameters:
Name | Type | Description |
---|---|---|
point | Common.Point |
Returns:
Current point
Type
multiply(point) → Common.Point
Applys multiplication. The original point is not altered.
Parameters:
Name | Type | Description |
---|---|---|
point | Common.Point |
Returns:
Transform as new Point
Type
multiplySelf(point) → Common.Point
Applys multiplication
Parameters:
Name | Type | Description |
---|---|---|
point | Common.Point |
Returns:
Current point
Type
scale(factor) → Common.Point
Scale point. The original point is not altered.
Parameters:
Name | Type | Description |
---|---|---|
factor | float | Scale factor |
Returns:
Transform as new Point
Type
scaleSelf(factor) → Common.Point
Scale point
Parameters:
Name | Type | Description |
---|---|---|
factor | float | Scale factor |
Returns:
Current point
Type
subtract(point) → Common.Point
Applys subtraction. The original point is not altered.
Parameters:
Name | Type | Description |
---|---|---|
point | Common.Point |
Returns:
Transform as new Point
Type
subtractSelf(point) → Common.Point
Applys subtraction
Parameters:
Name | Type | Description |
---|---|---|
point | Common.Point |
Returns:
Current point
Type
transform(matrix) → Common.Point
Transform point. The original point is not altered.
Parameters:
Name | Type | Description |
---|---|---|
matrix | Common.Matrix | Transform matrix |
Returns:
Transformed point
Type
transformSelf(matrix) → Common.Point
Transform point
Parameters:
Name | Type | Description |
---|---|---|
matrix | Common.Matrix | Transform matrix |
Returns:
Current point
Type
(static) fromPoint(point) → Common.Point
Creates a point from a given point data
Parameters:
Name | Type | Description |
---|---|---|
point | Common.Point|JSON|Array|TypedArray | Point data |
Returns:
Point instance
Type