Home  >  Article  >  Backend Development  >  What is the area of ​​a circle within a rectangle inscribed in a semicircle?

What is the area of ​​a circle within a rectangle inscribed in a semicircle?

PHPz
PHPzforward
2023-09-04 23:33:051619browse

Let us consider a given semicircle. Its radius is R. A rectangle of length l and width b is inscribed in the semicircle. Now, a circle of radius r is inscribed in the rectangle. We must find the area of ​​the inner circle.

What is the area of ​​a circle within a rectangle inscribed in a semicircle?

We know that the length of the largest rectangle inscribed in a semicircle is l and the width is b. Then the equations of l and b are as follows-

What is the area of ​​a circle within a rectangle inscribed in a semicircle?

What is the area of ​​a circle within a rectangle inscribed in a semicircle?

Now, the radius of the largest circle that can be inscribed in the rectangle is r as follows-

What is the area of ​​a circle within a rectangle inscribed in a semicircle?

Example

#include <iostream>
#include <cmath>
using namespace std;
float innerCircleArea(float R){
   return 3.1415 * pow(R / (2 * sqrt(2)), 2);
}
int main() {
   float rad = 12.0f;
   cout << "Area: " << innerCircleArea(rad);
}

Output

Area: 56.547

The above is the detailed content of What is the area of ​​a circle within a rectangle inscribed in a semicircle?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:tutorialspoint.com. If there is any infringement, please contact admin@php.cn delete