Home > Backend Development > C++ > body text

What is the largest Reuleaux triangle inside a square inscribed in an ellipse?

WBOY
Release: 2023-08-29 20:49:05
forward
1148 people have browsed it

Here we will see the area of ​​the largest Ruhr triangle inscribed in a square, which in turn is inscribed in an ellipse. We know that the length of the major axis of the ellipse is 2a and the length of the minor axis is 2b. The side length of the square is 'x' and the height of the Luer triangle is h.

What is the largest Reuleaux triangle inside a square inscribed in an ellipse?

We know that the side length of a square inscribed in an ellipse with a major axis of 2a and a minor axis of 2b is −

What is the largest Reuleaux triangle inside a square inscribed in an ellipse?

The height of the Ruhr triangle is the same as a. So h = x. Therefore, the area of ​​the Ruhr triangle is −

What is the largest Reuleaux triangle inside a square inscribed in an ellipse?.

Example

#include <iostream>
#include <cmath>
using namespace std;
float areaReuleaux(float a, float b) { //a and b are half of major and minor axis of ellipse
   if (a < 0 || b < 0) //either a or b is negative it is invalid
      return -1;
   float x = sqrt((a*a) + (b*b)) / (a*b);
   float area = ((3.1415 - sqrt(3)) * (x) * (x))/2;
   return area;
}
int main() {
   float a = 5;
   float b = 4;
   cout << "Area of Reuleaux Triangle: " << areaReuleaux(a, b);
}
Copy after login

Output

Area of Reuleaux Triangle: 0.0722343
Copy after login

The above is the detailed content of What is the largest Reuleaux triangle inside a square inscribed in an ellipse?. 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!