Skip to content

Commit

Permalink
add check to make sure sampling of curve is clock-wise
Browse files Browse the repository at this point in the history
mostly useful when resampling an entire data set to make sure sampling is the same direction
  • Loading branch information
jdtuck committed Oct 26, 2020
1 parent 5b68c3c commit 3382182
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ReSampleCurve.m
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@
[n,T] = size(X);
del = zeros(1,T);
del(1) = 0;
tst = X(:,2)-X(:,1);
if tst(1) < 0
X = fliplr(X);
end
for r = 2:T
del(r) = norm(X(:,r) - X(:,r-1));
end
Expand Down

0 comments on commit 3382182

Please sign in to comment.