Skip to content

textmode.js / Textmodifier / dist

Method: dist()

ts
dist(
   x1, 
   y1, 
   x2, 
   y2): number;

Calculate the Euclidean distance between two points.

Parameters

ParameterTypeDescription
x1numberX coordinate of the first point in grid cells.
y1numberY coordinate of the first point in grid cells.
x2numberX coordinate of the second point in grid cells.
y2numberY coordinate of the second point in grid cells.

Returns

number

The distance between the two points.

Example