Home >Backend Development >C++ >What is the area of ​​the Luer triangle?

What is the area of ​​the Luer triangle?

WBOY
WBOYforward
2023-09-03 08:45:091108browse

Here we will see how to calculate the area of ​​the Reuleaux triangle below. There is an equilateral triangle inside a Reuleaux triangle. Assuming its height is h, this shape is composed of the intersection of three circles.

What is the area of ​​the Luer triangle?

There are three circular sectors. The area of ​​each sector is −

What is the area of ​​the Luer triangle?

#Since the area of ​​an equilateral triangle is added three times, we must subtract them. Therefore the final area is −

What is the area of ​​the Luer triangle?

Example

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

Output

Area of Reuleaux Triangle: 25.3701

The above is the detailed content of What is the area of ​​the Luer triangle?. 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