# Biggest Reuleaux Triangle inscirbed within a square inscribed in a semicircle?

CServer Side ProgrammingProgramming

#### C in Depth: The Complete C Programming Guide for Beginners

45 Lectures 4.5 hours

#### Practical C++: Learn C++ Basics Step by Step

Most Popular

50 Lectures 4.5 hours

#### Master C and Embedded C Programming- Learn as you go

66 Lectures 5.5 hours

Here we will see the area of biggest Reuleax triangle inscribed within a square which is inscribed in a semicircle. Suppose the radius of the semicircle is R, are side of the square is ‘a’ and the height of the Reuleax triangle is h. We know that the side of the square inscribed in a semicircle is − The height of the Reuleaux triangle is the same as a. So a = h. So the area of the Reuleaux triangle is − ## 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);
}

## Output

Area of Reuleaux Triangle: 36.0819