textmode.js / TextmodeVector / dist
Method: dist()
Call Signature
ts
dist(value): number;Calculate the distance to another vector-like point.
Parameters
| Parameter | Type | Description |
|---|---|---|
value | | readonly number[] | | TextmodeVector | { x: number; y: number; z?: number; } | Vector-like value or component array to compare with. |
Returns
number
Euclidean distance between the two points.
Example
Call Signature
ts
dist(
x?,
y?,
z?): number;Calculate the distance to numeric components.
Parameters
| Parameter | Type | Description |
|---|---|---|
x? | number | X component of the point. |
y? | number | Y component of the point. |
z? | number | Z component of the point. |
Returns
number
Euclidean distance between the two points.