// Let's find the distance between coordinate A and coordinate B
distance = pointDistance(A.getX(), B.getX(), A.getY(), B.getY());
// Let's add the distance to the totalDistance array
totalDistance.add(new DoubleObject(distance));
// Let's set B to A, and clear B, so B can be set on the next iteration
A.clearAll();
A.set(B);
B.clearAll();
}
}
}
// Add in the distance of the outside circle that the plane will have to travel as well
totalDistance.add(new DoubleObject(tau * baseRadius));
// Return the answer as a DistancePath object
DistancePath dp = new DistancePath(addArray(totalDistance), distanceFromCenter, angleFromCenter, segmentType);
return dp;