# Area of a triangle inscribed in a rectangle which is inscribed in an ellipse?

EclipseServer Side ProgrammingProgramming

For understanding this complex problem, let's do it in two parts. First we will find the dimensions of the rectangle and based on that we can find the area of a triangle inscribed in it.

Using the equation of ellipse and differential calculus, mathematical formula for the area of a rectangle is,

area = 2ab,

where 2a = major axis and 2b = minor axis.

The largest triangle that can be inscribed in the rectangle, should stand on the same base & has height raising between the same parallel sides of the rectangle.

The area of largest triangle inscribed within the rectangle is half the area of rectangle enclosing it. By this,

Area of triangle = ½ area of rectangle.
area = ½ * (2ab) = ab

## Example

#include <stdio.h>
int main() {
float a = 5, b = 4; // major axis 2a and minor axis 2b
printf("The major axis of ellipse is %f and minor axis of ellipse is %f \n", 2*a , 2*b);
float area =a*b;
printf("area = %f", area);
return 0;
}

## Output

The major axis of ellipse is 10.000000 and minor axis of ellipse is 8.000000
area = 20.000000