#P4326. Area Difference in Euclidean and Taxicab Circles
Area Difference in Euclidean and Taxicab Circles
Area Difference in Euclidean and Taxicab Circles
In the 19th century, German mathematician Hermann Minkowski investigated a non-Euclidean geometry known as taxicab geometry. In this geometry, the distance between two points \(T_1(x_1,y_1)\) and \(T_2(x_2,y_2)\) is defined as
\(D(T_1,T_2)=|x_1-x_2|+|y_1-y_2|\).
A circle in any geometry is the set of all points at a fixed distance (the radius) from a fixed centre. In standard Euclidean geometry, the area of a circle with radius \(R\) is given by
\(\pi R^2\). However, in taxicab geometry, the "circle" (which actually forms a diamond shape) with radius \(R\) has an area of
\(2R^2\).
Your task is to compute the difference between the area of a Euclidean circle and that of a taxicab circle with the same radius, i.e.,
\[
\text{Difference} = \pi R^2 - 2R^2
\]
Be sure to output your result with at least 6 decimal places of precision.
inputFormat
The input consists of a single number \(R\) (\(R > 0\)), which represents the radius of the circles. The input is provided on a single line.
outputFormat
Output a single number representing the difference between the area of the Euclidean circle and the taxicab circle, computed as
\(\pi R^2 - 2R^2\). The result must be printed with at least 6 decimal places.
sample
1
1.141593