MCPcopy Create free account
hub / github.com/cortex-js/compute-engine / distance_formula

Function distance_formula

benchmarks/python-performance.py:71–73  ·  view source on GitHub ↗

r"""Distance Formula: \sqrt{(x_2-x_1)^2 + (y_2-y_1)^2}

(x_1, y_1, x_2, y_2)

Source from the content-addressed store, hash-verified

69
70import numpy as np
71def distance_formula(x_1, y_1, x_2, y_2):
72 r"""Distance Formula: \sqrt{(x_2-x_1)^2 + (y_2-y_1)^2}"""
73 return np.sqrt((-x_1 + x_2) ** 2 + (-y_1 + y_2) ** 2)
74
75
76import numpy as np

Callers 1

run_benchmarksFunction · 0.85

Calls 1

sqrtMethod · 0.65

Tested by

no test coverage detected