Area of Largest rectangle that can be inscribed in an Ellipse | Function to find the area of the rectangle ; a and b cannot be negative ; area of the rectangle ; Driver code
function rectanglearea ( a , b ) { if ( a < 0 b < 0 ) return - 1 ; return 2 * a * b ; } var a = 10 , b = 8 ; document . write ( rectanglearea ( a , b ) ) ;