summaryrefslogtreecommitdiffhomepage
path: root/tracker-pt/point_tracker.cpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2016-09-21 12:01:43 +0200
committerStanislaw Halik <sthalik@misaki.pl>2016-09-21 12:01:43 +0200
commit107570e6288d266825724010a6f0149eaaac40db (patch)
treeab357889f6cd009e6e6a89e89657c377d4bb05ab /tracker-pt/point_tracker.cpp
parent1c22f4a19a0cfa6b593b72754acb9ea97fbded13 (diff)
many: remove compat/pi-constant.hpp
With -D_USE_MATH_DEFINES MSVC defines the standard M_PI and friends. Since this preprocessor definition is now always passed as part of the build system for MSVC. We can use M_PI as if on a mission.
Diffstat (limited to 'tracker-pt/point_tracker.cpp')
-rw-r--r--tracker-pt/point_tracker.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/tracker-pt/point_tracker.cpp b/tracker-pt/point_tracker.cpp
index 4c7ca4be..24edca45 100644
--- a/tracker-pt/point_tracker.cpp
+++ b/tracker-pt/point_tracker.cpp
@@ -207,9 +207,6 @@ int PointTracker::POSIT(const PointModel& model, const PointOrder& order_, f foc
// In every iteration step the rotation closer to R_expected is taken
mat33 R_expected = mat33::eye();
- static constexpr f pi = constants::pi;
- static constexpr f eps = constants::eps;
-
// initial pose = last (predicted) pose
vec3 k;
get_row(R_expected, 2, k);
@@ -263,14 +260,14 @@ int PointTracker::POSIT(const PointModel& model, const PointOrder& order_, f foc
// CAVEAT don't change to comparison with an epsilon -sh 20160423
if (JJ0 == II0) {
rho = sqrt(fabs(2*IJ0));
- theta = -pi/4;
+ theta = -M_PI/4;
if (IJ0<0) theta *= -1;
}
else {
rho = sqrt(sqrt( (JJ0-II0)*(JJ0-II0) + 4*IJ0*IJ0 ));
theta = atan( -2*IJ0 / (JJ0-II0) );
// avoid branch misprediction
- theta += (JJ0 - II0 < 0) * pi;
+ theta += (JJ0 - II0 < 0) * M_PI;
theta *= f(.5);
}
@@ -313,7 +310,7 @@ int PointTracker::POSIT(const PointModel& model, const PointOrder& order_, f foc
// check for convergence condition
const f delta = fabs(epsilon_1 - old_epsilon_1) + fabs(epsilon_2 - old_epsilon_2);
- if (!(delta > eps))
+ if (!(delta > constants::eps))
break;
old_epsilon_1 = epsilon_1;