VOOZH about

URL: https://www.geeksforgeeks.org/dsa/circumradius-of-the-rectangle/

⇱ Circumradius of the rectangle - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Circumradius of the rectangle

Last Updated : 11 Jul, 2025

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.95227774224

👁 Image

Approach
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.5

Time Complexity: O(1)

Auxiliary Space: O(1)

Comment
Article Tags: