![]() |
VOOZH | about |
Here we have a rectangle of length l & breadth b. We have to find the circumradius of the rectangle.
Examples:
Input : l = 3, b = 4
Output :2.5
Input :l = 10, b = 12
Output :3.95227774224Approach:
From the diagram, we can clearly understand the circumradius r is half of the diagonal of the rectangle.
Below is the implementation of the above approach:
Output:
2.5Time Complexity: O(1)
Auxiliary Space: O(1)