Given two integers A and theta, denoting the length of a side of a rhombus and the vertex angle respectively, the task is to find the length of the diagonals of the rhombus.
Input: A = 10, theta = 30
Output: 19.32 5.18
Input: A = 6, theta = 45
Output: 11.09 4.59
The problem can be solved using the law of cosines. Using the law of cosines on triangles formed by the diagonals and sides of the rhombus gives the following relation to calculate the length of diagonals:
Below is the implementation of the above approach:
Time Complexity: O(1)
Auxiliary Space: O(1)
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.
- Area of Triangle using Side-Angle-Side (length of two sides and the included angle)
- Find the area of rhombus from given Angle and Side length
- Nth angle of a Polygon whose initial angle and per angle increment is given
- Program to calculate area and perimeter of a rhombus whose diagonals are given
- Program to calculate area of a rhombus whose one side and diagonal are given
- Angle subtended by the chord when the angle subtended by another chord of same length is given
- Angle between a chord and a tangent when angle in the alternate segment is given
- Find the vertex diagonally opposite to the vertex M from an N-sided polygon
- Check if every vertex triplet in graph contains two vertices connected to third vertex
- Exterior angle of a cyclic quadrilateral when the opposite interior angle is given
- Angle subtended by the chord to center of the circle when the angle subtended by the another equal chord of a congruent circle is given
- Program to calculate angle on circumference subtended by the chord when the central angle subtended by the chord is given
- Length of Diagonals of a Cyclic Quadrilateral using the length of Sides.
- Area of the biggest possible rhombus that can be inscribed in a rectangle
- Area of circle inscribed within rhombus
- Radius of the biggest possible circle inscribed in rhombus which in turn is inscribed in a rectangle
- Length of diagonal of a parallelogram using adjacent sides and angle between them
- Length of the chord of the circle whose radius and the angle subtended at the center by the chord is given
- Arc length from given Angle
- Swap major and minor diagonals of a square matrix
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. 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.