Home > Backend Development > C++ > body text

What is the area of ​​the Luer triangle?

WBOY
Release: 2023-09-03 08:45:09
forward
1057 people have browsed it

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);
}
Copy after login

Output

Area of Reuleaux Triangle: 25.3701
Copy after login

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!

Related labels:
source:tutorialspoint.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!