# Area of the biggest possible rhombus that can be inscribed in a rectangle

Given a rectangle of length **l** and breadth **b**, the task is to find the largest rhombus that can be inscribed in the rectangle.

**Examples**:

Input : l = 5, b = 4 Output : 10 Input : l = 16, b = 6 Output : 48

From the figure, we can see, the biggest rhombus that could be inscribed within the rectangle, will have its diagonals equal to the length & breadth of the rectangle.

So, Area of rhombus, **A = (l*b)/2**

Below is the implementation of the above approach:

## C++

`// C++ Program to find the the biggest rhombus ` `// which can be inscribed within the rectangle ` `#include <bits/stdc++.h> ` `using` `namespace` `std; ` ` ` `// Function to find the area ` `// of the biggest rhombus ` `float` `rhombusarea(` `float` `l, ` `float` `b) ` `{ ` ` ` `// the length and breadth cannot be negative ` ` ` `if` `(l < 0 || b < 0) ` ` ` `return` `-1; ` ` ` ` ` `// area of the rhombus ` ` ` `return` `(l * b) / 2; ` `} ` ` ` `// Driver code ` `int` `main() ` `{ ` ` ` `float` `l = 16, b = 6; ` ` ` `cout << rhombusarea(l, b) << endl; ` ` ` `return` `0; ` `} ` |

*chevron_right*

*filter_none*

## Java

`// Java Program to find the the ` `// biggest rhombus which can be ` `// inscribed within the rectangle ` `import` `java.io.*; ` ` ` `class` `GFG ` `{ ` ` ` `// Function to find the area ` `// of the biggest rhombus ` `static` `float` `rhombusarea(` `float` `l, ` ` ` `float` `b) ` `{ ` ` ` `// the length and breadth ` ` ` `// cannot be negative ` ` ` `if` `(l < ` `0` `|| b < ` `0` `) ` ` ` `return` `-` `1` `; ` ` ` ` ` `// area of the rhombus ` ` ` `return` `(l * b) / ` `2` `; ` `} ` ` ` `// Driver code ` `public` `static` `void` `main (String[] args) ` `{ ` ` ` `float` `l = ` `16` `, b = ` `6` `; ` ` ` `System.out.println(rhombusarea(l, b)); ` `} ` `} ` ` ` `// This code is contributed ` `// by inder_verma ` |

*chevron_right*

*filter_none*

## Pyhton3

`# Python 3 Program to find the the biggest rhombus ` `# which can be inscribed within the rectangle ` ` ` ` ` `# Function to find the area ` `# of the biggest rhombus ` `def` `rhombusarea(l,b): ` ` ` `# the length and breadth cannot be negative ` ` ` `if` `(l < ` `0` `or` `b < ` `0` `): ` ` ` `return` `-` `1` ` ` ` ` `# area of the rhombus ` ` ` `return` `(l ` `*` `b) ` `/` `2` ` ` `# Driver code ` `if` `__name__ ` `=` `=` `'__main__'` `: ` ` ` `l ` `=` `16` ` ` `b ` `=` `6` ` ` `print` `(rhombusarea(l, b)) ` |

*chevron_right*

*filter_none*

## C#

`// C# Program to find the the ` `// biggest rhombus which can be ` `// inscribed within the rectangle ` `using` `System; ` ` ` `class` `GFG ` `{ ` ` ` `// Function to find the area ` `// of the biggest rhombus ` `static` `float` `rhombusarea(` `float` `l, ` ` ` `float` `b) ` `{ ` ` ` `// the length and breadth ` ` ` `// cannot be negative ` ` ` `if` `(l < 0 || b < 0) ` ` ` `return` `-1; ` ` ` ` ` `// area of the rhombus ` ` ` `return` `(l * b) / 2; ` `} ` ` ` `// Driver code ` `public` `static` `void` `Main () ` `{ ` ` ` `float` `l = 16, b = 6; ` ` ` `Console.WriteLine(rhombusarea(l, b)); ` `} ` `} ` ` ` `// This code is contributed ` `// by shs ` |

*chevron_right*

*filter_none*

## PHP

`<?php ` `// PHP Program to find the the ` `// biggest rhombus which can be ` `// inscribed within the rectangle ` ` ` `// Function to find the area ` `// of the biggest rhombus ` `function` `rhombusarea(` `$l` `, ` `$b` `) ` `{ ` ` ` `// the length and breadth ` ` ` `// cannot be negative ` ` ` `if` `(` `$l` `< 0 || ` `$b` `< 0) ` ` ` `return` `-1; ` ` ` ` ` `// area of the rhombus ` ` ` `return` `(` `$l` `* ` `$b` `) / 2; ` `} ` ` ` `// Driver code ` `$l` `= 16; ` `$b` `= 6; ` `echo` `rhombusarea(` `$l` `, ` `$b` `) . ` `"\n"` `; ` ` ` `// This code is contributed ` `// by Akanksha Rai(Abby_akku) ` |

*chevron_right*

*filter_none*

**Output:**

48

## Recommended Posts:

- Radius of the biggest possible circle inscribed in rhombus which in turn is inscribed in a rectangle
- Area of the biggest ellipse inscribed within a rectangle
- Area of circle inscribed within rhombus
- The biggest possible circle that can be inscribed in a rectangle
- Area of a circle inscribed in a rectangle which is inscribed in a semicircle
- Area of a triangle inscribed in a rectangle which is inscribed in an ellipse
- Ratio of area of a rectangle with the rectangle inscribed in it
- Area of largest triangle that can be inscribed within a rectangle
- Area of Largest rectangle that can be inscribed in an Ellipse
- Biggest Reuleaux Triangle inscribed within a square which is inscribed within an ellipse
- Biggest Reuleaux Triangle inscribed within a square which is inscribed within a hexagon
- Largest ellipse that can be inscribed within a rectangle which in turn is inscribed within a semicircle
- Biggest Reuleaux Triangle inscribed within a Square inscribed in an equilateral triangle
- Area of a square inscribed in a circle which is inscribed in an equilateral triangle
- Area of a square inscribed in a circle which is inscribed in a hexagon

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.