Skip to content

textmode.js / TextmodeVector / dist

Method: dist() ​

Call Signature ​

ts
dist(value): number;

Calculate the distance to another vector-like point.

Parameters ​

ParameterTypeDescription
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 ​

ParameterTypeDescription
x?numberX component of the point.
y?numberY component of the point.
z?numberZ component of the point.

Returns ​

number

Euclidean distance between the two points.

Example ​