mirror of https://github.com/CGAL/cgal
Use std::clamp
This commit is contained in:
parent
2838ad24d9
commit
20115d3dcb
|
|
@ -972,15 +972,7 @@ namespace CommonKernelFunctors {
|
|||
|
||||
// cosine
|
||||
double dot = to_double(scalar_product(u,v));
|
||||
double cosine = dot / product;
|
||||
|
||||
if(cosine > 1.){
|
||||
cosine = 1.;
|
||||
}
|
||||
if(cosine < -1.){
|
||||
cosine = -1.;
|
||||
}
|
||||
|
||||
double cosine = std::clamp(dot / product, -1., 1.);
|
||||
return std::acos(cosine) * 180./CGAL_PI;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue