Home > Backend Development > C++ > body text

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

PHPz
Release: 2023-09-14 08:53:01
forward
943 people have browsed it

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

Output

Area of Reuleaux Triangle: 36.0819
Copy after login

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!

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