Area of largest isosceles triangle that can be inscribed in an Ellipse whose vertex coincides with one extremity of the major axis | C ++ program for the above approach ; Function to calculate area of the isosceles triangle ; If a and b are negative ; Stores the area of the triangle ; Print the area ; Driver code ; Given value of a & b ; Function call to find the area of the isosceles triangle
#include <bits/stdc++.h> NEW_LINE using namespace std ; void triangleArea ( float a , float b ) { if ( a < 0 b < 0 ) { cout << -1 ; return ; } float area = ( 3 * sqrt ( 3 ) * a * b ) / ( 4 ) ; cout << area ; } int main ( ) { float a = 1 , b = 2 ; triangleArea ( a , b ) ; return 0 ; }