mirror of
https://github.com/nikdoof/django-evesde.git
synced 2025-12-18 20:29:23 +00:00
Added function to calculate the distance between systems.
This commit is contained in:
6
evesde/utils.py
Normal file
6
evesde/utils.py
Normal file
@@ -0,0 +1,6 @@
|
||||
from math import sqrt
|
||||
|
||||
|
||||
def euclidean_distance(origin, destination):
|
||||
"""Calculates the Euclidean distance of two sets of x/y/z tuples"""
|
||||
return sqrt(sum((a - b)**2 for a, b in zip(origin, destination)))
|
||||
Reference in New Issue
Block a user