Home > Article > Backend Development > What is the largest Luras curve triangle inscribed in a square within a semicircle?
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.
We know that the side length of a square inscribed in a semicircle is -
The height of Lucas's triangle is Side lengths are equal. So a = h. Therefore the area of Lucas triangle is -
#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); }
Area of Reuleaux Triangle: 36.0819
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!