checking sign before using squared cos angle

This commit is contained in:
Sven Oesau 2025-07-23 10:37:04 +02:00
parent c3e3c0eb31
commit 547e2a3c0f
2 changed files with 8 additions and 0 deletions

View File

@ -241,6 +241,10 @@ namespace Point_set {
const FT cos_value =
m_scalar_product_2(query_normal, m_normal_of_best_fit);
if (cos_value < 0)
return false;
const FT squared_cos_value = cos_value * cos_value;
FT squared_cos_value_threshold =

View File

@ -244,6 +244,10 @@ namespace Segment_set {
const FT cos_value =
m_scalar_product(query_direction, m_direction_of_best_fit);
if (cos_value < 0)
return false;
const FT squared_cos_value = cos_value * cos_value;
FT squared_cos_value_threshold =