textmode.js / Textmodifier / dist
Method: dist()
ts
dist(
x1,
y1,
x2,
y2): number;Calculate the Euclidean distance between two points.
Parameters
| Parameter | Type | Description |
|---|---|---|
x1 | number | X coordinate of the first point in grid cells. |
y1 | number | Y coordinate of the first point in grid cells. |
x2 | number | X coordinate of the second point in grid cells. |
y2 | number | Y coordinate of the second point in grid cells. |
Returns
number
The distance between the two points.