[chronojump] Cleaning code in getDiametersPer[Tick,Ms]
- From: Xavier Padullés <xpadulles src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [chronojump] Cleaning code in getDiametersPer[Tick,Ms]
- Date: Mon, 27 Apr 2015 17:24:11 +0000 (UTC)
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]