From d864f8b68dcf496f39fc0e12b1435b7d8ea46853 Mon Sep 17 00:00:00 2001 From: Keuin Date: Tue, 12 Apr 2022 13:03:15 +0800 Subject: Replace dot with mod2. --- main_simple_scanner.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'main_simple_scanner.cpp') 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; -- cgit v1.2.3