Home > Article > Backend Development > What is the area of a circle within a rectangle inscribed in a semicircle?
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.
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-
Now, the radius of the largest circle that can be inscribed in the rectangle is r as follows-
#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); }
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!