Constructor
new Point(xopt, yopt)
Creates a new point.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
x |
number |
<optional> |
0.0 | The horizontal coordinate. |
y |
number |
<optional> |
0.0 | The vertical coordinate. |
- Source:
Members
x :number
The horizontal coordinate of the point. The default value is 0.
Type:
- number
- Source:
y :number
The vertical coordinate of the point. The default value is 0.
Type:
- number
- Source:
Methods
(static) distance(x1, y1, x2, y2) → {number}
Returns the distance between two points.
Parameters:
Name | Type | Description |
---|---|---|
x1 |
number | The x coordinate of the first point. |
y1 |
number | The y coordinate of the first point. |
x2 |
number | The x coordinate of the second point. |
y2 |
number | The y coordinate of the second point. |
- Source:
Returns:
- Type
- number
(static) interpolate(x1, y1, x2, y2, fopt, oopt) → {rune.geom.Point}
Returns the linear interpolation point between the two given points.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
x1 |
number | The x coordinate of the first point. | |
y1 |
number | The y coordinate of the first point. | |
x2 |
number | The x coordinate of the second point. | |
y2 |
number | The y coordinate of the second point. | |
f |
number |
<optional> |
The level of interpolation between the two points. |
o |
rune.geom.Point |
<optional> |
Store results in this object. |
- Source:
Returns:
The new, interpolated point.
- Type
- rune.geom.Point
distance(point) → {number}
Returns the distance between the current and specified point.
Parameters:
Name | Type | Description |
---|---|---|
point |
rune.geom.Point | The specified point. |
- Source:
Returns:
- Type
- number
interpolate(point, fractionopt, outputopt) → {rune.geom.Point}
Determines a point between two specified points. The parameter fraction
determines where the new interpolated point is located relative to the two
end points.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
point |
rune.geom.Point | The second point. | |
fraction |
number |
<optional> |
The level of interpolation between the two points. |
output |
rune.geom.Point |
<optional> |
Save results to this object. |
- Source:
Returns:
The new, interpolated point.
- Type
- rune.geom.Point
toString() → {string}
Returns a string that contains the values of the x and y coordinates.
- Source:
Returns:
The string representation of the coordinates.
- Type
- string