![]() |
Given here is a semicircle of radius r which inscribes a square which in turn inscribes a reuleaux triangle. The task is to find the maximum possible area of this reuleaux triangle. Input : x = 5 Output : 14.0954 Input : x = 8 Output : 36.0842
Approach:We know, the side of the square inscribed within a semicircle is, a = 2r/?5. (Please refer here) A = 0.70477*x^2 = 0.70477*(r^2/5) Below is the implementation of the above approach: C++
Javascript
Output:
14.0954
Time Complexity: O(1) Auxiliary Space: O(1) |
Reffered: https://www.geeksforgeeks.org
C++ Programs |
Type: | Geek |
Category: | Coding |
Sub Category: | Tutorial |
Uploaded by: | Admin |
Views: | 10 |