summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--tracker-pt/ftnoir_tracker_pt.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/tracker-pt/ftnoir_tracker_pt.cpp b/tracker-pt/ftnoir_tracker_pt.cpp
index ce19d592..2a13e3c6 100644
--- a/tracker-pt/ftnoir_tracker_pt.cpp
+++ b/tracker-pt/ftnoir_tracker_pt.cpp
@@ -68,10 +68,10 @@ bool Tracker_PT::get_focal_length(f& ret)
using std::atan;
using std::sqrt;
- const int w = info.res_x, h = info.res_y;
- const double diag = sqrt(1. + h/(double)w * h/(double)w);
+ const double w = info.res_x, h = info.res_y;
+ const double diag = sqrt(w/h*w/h + h/w*h/w);
const double diag_fov = static_cast<int>(s.fov) * M_PI / 180.;
- const double fov = 2.*atan(tan(diag_fov/2.0)/diag);
+ const double fov = 2.*atan(tan(diag_fov/2.)/diag);
ret = .5 / tan(.5 * fov);
return true;
}