diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2016-06-12 19:31:59 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2016-06-14 18:14:46 +0200 |
commit | 17b26bdd8d143027ec885fc6a1b5336947067e8b (patch) | |
tree | 4cf8b42f8bbd611c72fde5cc1ae690dd90d4338c /tracker-test/test.cpp | |
parent | 785e37b6164a6516a90b12aaa80c7c58fc6b9d21 (diff) |
tracker/test: treat translation separately
Diffstat (limited to 'tracker-test/test.cpp')
-rw-r--r-- | tracker-test/test.cpp | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/tracker-test/test.cpp b/tracker-test/test.cpp index b9376c98..842b24b0 100644 --- a/tracker-test/test.cpp +++ b/tracker-test/test.cpp @@ -14,7 +14,7 @@ const double FTNoIR_Tracker::incr[6] = { - 2, 3, 4, + 50, 40, 80, 70, 5, 3 }; @@ -44,20 +44,23 @@ void FTNoIR_Tracker::data(double *data) for (int i = 0; i < 6; i++) { - double x = last_x[i] + incr[i] * d2r * dt; - - x = fmod(x , 2 * pi); - + double x = fmod(last_x[i] + incr[i] * d2r * dt, + 2 * pi); last_x[i] = x; - if (x > pi + pi/2) + if (i >= 3) { - x -= pi; - } - - double ret = sin(x) * 180; + if (x > pi + pi/2) + x -= pi; + else if (x > pi/2 && x < pi) + x += pi; - data[i] = ret; + data[i] = sin(x) * 180; + } + else + { + data[i] = sin(x) * 100; + } } } |