-
Notifications
You must be signed in to change notification settings - Fork 0
/
distance.m
28 lines (23 loc) · 1.39 KB
/
distance.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
% distance - calculates distances between primary and secondary seeds
disp('DISTANCE - calculate distances between all primary and secondary particle seeds.');
%% CALCULATE STRETCHING -"UP"
deltaXUp = xn - xnUp; % calculate pointwise difference between xn and xnUp
deltaYUp = yn - ynUp; % calculate pointwise difference between yn and ynUp
distUp = (deltaXUp.^2 + deltaYUp.^2).^0.50; % calculate euclidean distance 2D between primary and secondary "up"
%%
%% CALCULATE STRETCHING -"DOWN"
deltaXDn = xn - xnDn; % calculate pointwise difference between xn and xnUp
deltaYDn = yn - ynDn; % calculate pointwise difference between yn and ynUp
distDn = (deltaXDn.^2 + deltaYDn.^2).^0.50; % calculate euclidean distance 2D between primary and secondary "down"
%%
%% CALCULATE STRETCHING -"LEFT"
deltaXLt = xn - xnLt; % calculate pointwise difference between xn and xnUp
deltaYLt = yn - ynLt; % calculate pointwise difference between yn and ynUp
distLt = (deltaXLt.^2 + deltaYLt.^2).^0.50; % calculate euclidean distance 2D between primary and secondary "left"
%%
%% CALCULATE STRETCHING -"RIGHT"
deltaXRt = xn - xnRt; % calculate pointwise difference between xn and xnUp
deltaYRt = yn - ynRt; % calculate pointwise difference between yn and ynUp
distRt = (deltaXRt.^2 + deltaYRt.^2).^0.50; % calculate euclidean distance 2D between primary and secondary "right"
%%
disp('All distances calculated.');