Prevents divide by zero when clothoid constant is 0.0

This commit is contained in:
Richard Brice
2024-05-20 13:17:18 -07:00
parent fbb51a6705
commit a45f6f980f
+3 -1
View File
@@ -171,7 +171,9 @@ class curve_segment_evaluator {
} else {
// This functor is f'(x) = dy/dx
auto df = [fnX,fnY](double t) -> double {
return fnY(t) / fnX(t);
auto dy = fnY(t);
auto dx = fnX(t);
return dx ? dy / dx : 0.0;
};
// This functor computes the curve length