From 3382182dab76c7f9f3aacd7643c8dc51562c0040 Mon Sep 17 00:00:00 2001 From: "J. Derek Tukcer" Date: Sun, 25 Oct 2020 19:37:00 -0600 Subject: [PATCH] add check to make sure sampling of curve is clock-wise mostly useful when resampling an entire data set to make sure sampling is the same direction --- ReSampleCurve.m | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ReSampleCurve.m b/ReSampleCurve.m index 7476087..3679cd8 100644 --- a/ReSampleCurve.m +++ b/ReSampleCurve.m @@ -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