mirror of https://github.com/CGAL/cgal
checking sign before using squared cos angle
This commit is contained in:
parent
c3e3c0eb31
commit
547e2a3c0f
|
|
@ -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 =
|
||||
|
|
|
|||
|
|
@ -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 =
|
||||
|
|
|
|||
Loading…
Reference in New Issue