maths.euclidean_distance ======================== .. py:module:: maths.euclidean_distance Attributes ---------- .. autoapisummary:: maths.euclidean_distance.Vector maths.euclidean_distance.VectorOut Functions --------- .. autoapisummary:: maths.euclidean_distance.benchmark maths.euclidean_distance.euclidean_distance maths.euclidean_distance.euclidean_distance_no_np Module Contents --------------- .. py:function:: benchmark() -> None Benchmarks .. py:function:: 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 .. py:function:: 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 .. py:data:: Vector .. py:data:: VectorOut