[chronojump] Cleaning code in getDiametersPer[Tick,Ms]



commit b7d1cda0a414649bde8c486d4bd8b0680b62ccf4
Author: Xavier Padullés <x padulles gmail com>
Date:   Mon Apr 27 19:19:41 2015 +0200

    Cleaning code in getDiametersPer[Tick,Ms]

 encoder/util.R |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/encoder/util.R b/encoder/util.R
index 2e25b89..befbd58 100644
--- a/encoder/util.R
+++ b/encoder/util.R
@@ -896,8 +896,9 @@ getInertialDiametersPerTick <- function(d_vector)
   return(d.approx$y)
 }
 #Returns the instant diameter every milisecond
-getInertialDiametersPerMs <- function(diameterPerTick, displacement)
+getInertialDiametersPerMs <- function(displacement, diametersPerTick)
 {
-  return(diameterPerTick[abs(cumsum(displacement))])
+  diameter <- diametersPerTick[abs(cumsum(displacement)) + 1]
+  return(diameter)
 }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]