Skip to content

Commit

Permalink
euclidean distance network
Browse files Browse the repository at this point in the history
  • Loading branch information
Harang Ju committed Mar 20, 2019
1 parent 1abc455 commit 3b7c5de
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions +generators/euclidean.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
function d = euclidean(p)
%Euclidean distance
% parameters
% x (float) vector of position in x-axis <br>
% y (float) vector of position in y-axis <br>
% z (float, default=0) vector of position in z-axis
if ~isfield(p,'z'); p.z = zeros(size(p.x)); end
d.A = sqrt((p.x-p.x').^2+(p.y-p.y').^2+(p.z-p.z').^2);
end

0 comments on commit 3b7c5de

Please sign in to comment.