Math module

distance

procedure · 3 overloadsSource

The distance between two points, length(a - b).

ExampleOpen in playground ↗
assert(distance(xyz(1, 1, 1), xyz(1, 4, 5)) == 5);
distance :: (a: Vector2, b: Vector2) -> float

The distance between two points.

Parameters

a: Vector2
the first point.
b: Vector2
the second point.

Returns

float
distance :: (a: Vector3, b: Vector3) -> float

The distance between two points.

Parameters

a: Vector3
the first point.
b: Vector3
the second point.

Returns

float
distance :: (a: Vector4, b: Vector4) -> float

The distance between two points.

Parameters

a: Vector4
the first point.
b: Vector4
the second point.

Returns

float

See also