Home > Backend Development > C++ > body text

What is the largest Ruero triangle inscribed in a square that is a right triangle?

PHPz
Release: 2023-09-04 22:29:06
forward
1513 people have browsed it

Here we will see the area of ​​a largest Reuleaux triangle inscribed in a square, which in turn is inscribed in a right triangle. The side length of the square is 'a'. The height of Reuleaux's triangle is x. The base of the triangle is b, the height is l, and the hypotenuse is h.

What is the largest Ruero triangle inscribed in a square that is a right triangle?

We know that the side length of a square inscribed in a right triangle with height l and base b is -

What is the largest Ruero triangle inscribed in a square that is a right triangle?

The height of a Reuleaux triangle is the same as a. So a = x. Therefore, the area of ​​the Reuleaux triangle is -

What is the largest Ruero triangle inscribed in a square that is a right triangle?

##Example

#include <iostream>
#include <cmath>
using namespace std;
float areaReuleaux(float l, float b) { //l and b are height and base of right angled triangle
   if (l < 0 || b < 0) //either l or b is negative it is invalid
      return -1;
   float a = (l*b)/(l+b);
   float area = ((3.1415 - sqrt(3)) * (a) * (a))/2;
   return area;
}
int main() {
   float l = 5;
   float b = 12;
   cout << "Area of Reuleaux Triangle: " << areaReuleaux(l, b);
}
Copy after login

Output

Area of Reuleaux Triangle: 8.77858
Copy after login

The above is the detailed content of What is the largest Ruero triangle inscribed in a square that is a right 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!