summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--main_simple_scanner.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/main_simple_scanner.cpp b/main_simple_scanner.cpp
index 4d73d54..709914b 100644
--- a/main_simple_scanner.cpp
+++ b/main_simple_scanner.cpp
@@ -54,12 +54,12 @@ public:
const auto c2s = r.source() - center; // center to source
// A = D dot D
- const double a = dot(r.direction(), r.direction());
+ const double a = r.direction().mod2();
// H = (S - C) dot D
const auto h = dot(c2s, r.direction());
// B = 2H ( not used in our optimized routine )
// C = (S - C) dot (S - C) - radius^2
- const double c = dot(c2s, c2s) - radius * radius;
+ const double c = c2s.mod2() - radius * radius;
// 4delta = H^2 - AC
// delta_q = H^2 - AC (quarter delta)
const double delta_q = h * h - a * c;