mirror of
https://gitlab.science.ru.nl/mthesis-edeboone/m-thesis-introduction.git
synced 2024-11-13 01:53:31 +01:00
Simu: distance sum over last axis
This commit is contained in:
parent
99cd7264f0
commit
a50f6640a4
2 changed files with 2 additions and 2 deletions
|
@ -5,7 +5,7 @@ def distance(x1, x2):
|
|||
"""
|
||||
Calculate the Euclidean distance between two locations x1 and x2
|
||||
"""
|
||||
return np.sqrt( np.sum( (x1 - x2)**2, axis=0) )
|
||||
return np.sqrt( np.sum( (x1 - x2)**2, axis=-1) )
|
||||
|
||||
def plot_geometry(ax, emitters=[], antennae=[], unit='m'):
|
||||
"""
|
||||
|
|
|
@ -53,7 +53,7 @@ class Signal():
|
|||
if x_0 is None:
|
||||
x_0 = self.x_0
|
||||
|
||||
return np.sum(np.sqrt( (x_f - x_0)**2 )/velocity)
|
||||
return np.sqrt( np.sum((x_f - x_0)**2, axis=-1) )/velocity
|
||||
|
||||
def temporal_time_offset(self, t_f, t_0=None):
|
||||
"""
|
||||
|
|
Loading…
Reference in a new issue