mirror of https://github.com/CGAL/cgal
Safeguard against division by zero
This commit is contained in:
parent
8677a81439
commit
de9c1f3dc9
|
|
@ -99,6 +99,9 @@ public:
|
||||||
|
|
||||||
const FT n = CGAL::approximate_sqrt(CGAL::square(gx) + CGAL::square(gy) + CGAL::square(gz));
|
const FT n = CGAL::approximate_sqrt(CGAL::square(gx) + CGAL::square(gy) + CGAL::square(gz));
|
||||||
|
|
||||||
|
if(is_zero(n))
|
||||||
|
return vector(0,0,0);
|
||||||
|
|
||||||
return vector(gx / n, gy / n, gz / n);
|
return vector(gx / n, gy / n, gz / n);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue