StackOverflowError when executing Circle.linearizeArc

Description

Executing the following code results in a StackOverflowError:

1 2 3 4 5 6 7 8 9 10 List<Coordinate> coordinates = new ArrayList<Coordinate>(); coordinates.add(new Coordinate(194691.519, 325504.109)); coordinates.add(new Coordinate(194691.514, 325504.089)); coordinates.add(new Coordinate(194691.523, 325504.108)); Coordinate[] orderedCoordinates = coordinates.toArray(new Coordinate[coordinates.size()]); double tolerance = 0.001; Coordinate[] result = Circle.linearizeArc( orderedCoordinates[0].x, orderedCoordinates[0].y, orderedCoordinates[1].x, orderedCoordinates[1].y, orderedCoordinates[2].x, orderedCoordinates[2].y, tolerance);

When I set the value of the smallNumber variable in the method initThreePointCircle equal to the tolerance the function works.

Another thing I noticed in the initThreePointCircle method is the if statement after the declaration of the smallNumber variable:

1 2 if ( ( Math.abs( a13 ) < smallNumber && Math.abs( b13 ) < smallNumber ) || ( Math.abs( a13 ) < smallNumber && Math.abs( b13 ) < smallNumber )

it says if (a || a), where a is ( Math.abs( a13 ) < smallNumber && Math.abs( b13 ) < smallNumber ) should the second part be something else?

Environment

None

Status

Assignee

Unassigned

Reporter

Erwin

Fix versions

None

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Components

Affects versions

4.3.0.Final

Priority

Major