The Ant and the Tree
An ant is situated in a forest on a flat surface at the coordinates (x_1, y_1) and is moving towards the point (x_2, y_2). Within this forest, there is a tree with a circular trunk base centered at (x, y) and having a radius of r. This tree may block the ant's direct path to its destination, requiring the ant to navigate around the trunk.
Your task is to write a program that calculates the shortest possible path the ant can take.
Input
The input consists of real numbers x_1, y_1, x_2, y_2, x, y, r, separated by spaces. Each number ranges from 0 to 1000, with r > 0. The ant's starting and ending points are not located inside the circle.
Output
Output a single real number representing the length of the shortest path. Ensure the result's absolute error does not exceed 0.01, meaning the number should be presented with at least 3 decimal places of precision.