Home  >  Article  >  Backend Development  >  What is the largest Luras curve triangle inscribed in a square within a semicircle?

What is the largest Luras curve triangle inscribed in a square within a semicircle?

PHPz
PHPzforward
2023-09-14 08:53:01889browse

Here we will see the area of ​​the largest Lucas triangle inscribed in a semicircle by a square. Suppose the radius of the semicircle is R, the side length of the square is ‘a’, and the height of the Lucas triangle is h.

What is the largest Luras curve triangle inscribed in a square within a semicircle?

We know that the side length of a square inscribed in a semicircle is -

What is the largest Luras curve triangle inscribed in a square within a semicircle?

The height of Lucas's triangle is Side lengths are equal. So a = h. Therefore the area of ​​Lucas triangle is -

What is the largest Luras curve triangle inscribed in a square within a semicircle?

Example

#include <iostream>
#include <cmath>
using namespace std;
float areaReuleaux(float r) { //radius of the semicircle is r
   if (r < 0) //if r is negative it is invalid
      return -1;
   float area = ((3.1415 - sqrt(3)) * (2*r/(sqrt(5))) * (2*r/(sqrt(5))))/2;
   return area;
}
int main() {
   float rad = 8;
   cout << "Area of Reuleaux Triangle: " << areaReuleaux(rad);
}

Output

Area of Reuleaux Triangle: 36.0819

The above is the detailed content of What is the largest Luras curve triangle inscribed in a square within 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