maths.euclidean_distance¶
Attributes¶
Functions¶
|
Benchmarks |
|
Calculate the distance between the two endpoints of two vectors. |
|
Calculate the distance between the two endpoints of two vectors without numpy. |
Module Contents¶
- maths.euclidean_distance.benchmark() None ¶
Benchmarks
- maths.euclidean_distance.euclidean_distance(vector_1: Vector, vector_2: Vector) VectorOut ¶
Calculate the distance between the two endpoints of two vectors. A vector is defined as a list, tuple, or numpy 1D array. >>> float(euclidean_distance((0, 0), (2, 2))) 2.8284271247461903 >>> float(euclidean_distance(np.array([0, 0, 0]), np.array([2, 2, 2]))) 3.4641016151377544 >>> float(euclidean_distance(np.array([1, 2, 3, 4]), np.array([5, 6, 7, 8]))) 8.0 >>> float(euclidean_distance([1, 2, 3, 4], [5, 6, 7, 8])) 8.0
- maths.euclidean_distance.euclidean_distance_no_np(vector_1: Vector, vector_2: Vector) VectorOut ¶
Calculate the distance between the two endpoints of two vectors without numpy. A vector is defined as a list, tuple, or numpy 1D array. >>> euclidean_distance_no_np((0, 0), (2, 2)) 2.8284271247461903 >>> euclidean_distance_no_np([1, 2, 3, 4], [5, 6, 7, 8]) 8.0
- maths.euclidean_distance.Vector¶
- maths.euclidean_distance.VectorOut¶