get_distance

Contents

get_distance#

zeroheliumkit.src.functions.get_distance(p1: tuple | Point | Anchor, p2: tuple | Point | Anchor) float[source]#

Returns the Euclidean distance between two points.

Parameters:
  • p1 (tuple | Point | Anchor) – The coordinates of the first point.

  • p2 (tuple | Point | Anchor) – The coordinates of the second point.

Returns:

The Euclidean distance between the two points.

Return type:

float

Example

>>> p1 = (0, 0)
>>> p2 = (3, 4)
>>> distance = get_distance(p1, p2)
>>> print(distance)
    5.0