I believe the Pythagorean theorem code should have a subtraction, not an addition. While debug rendering the calculated intersection points, the original code could generate points that were wildly off. Changing the formula now generates the intersection points directly on the radius of the sphere/circle.
This might not have much impact on obstacle avoidance (the original points would indeed steer the vehicle away from the obstacle) but it should allow the vehicles to have a closer tolerance to the obstacle.
I believe the Pythagorean theorem code should have a subtraction, not an addition. While debug rendering the calculated intersection points, the original code could generate points that were wildly off. Changing the formula now generates the intersection points directly on the radius of the sphere/circle.
This might not have much impact on obstacle avoidance (the original points would indeed steer the vehicle away from the obstacle) but it should allow the vehicles to have a closer tolerance to the obstacle.