Given that all the angles of a quadrilateral are in AP having common difference ‘d’, the task is to find all the angles.
Input: d = 10 Output: 75, 85, 95, 105 Input: d = 20 Output: 60, 80, 100, 120
We know that the angles of the quadrilateral are in AP and having the common difference ‘d’.
So, if we assume the first angle to be ‘a’ then the other angles can be calculated as,
‘a+d’, ‘a+2d’ and ‘a+3d’
And, from the properties of quadrilaterals, the sum of all the angles of a quadrilateral is 360. So,
(a) + (a + d) + (a + 2*d) + (a + 3*d) = 360
4*a + 6*d = 360
a = (360 – (6*d)) / 4
where ‘a’ is the angle assumed in the beginning and ‘d’ is the common difference.
Below is the implementation of the above approach:
75, 85, 95, 105
- Check whether Quadrilateral is valid or not if angles are given
- Program to find smallest difference of angles of two parts of a given circle
- Find the area of quadrilateral when diagonal and the perpendiculars to it from opposite vertices are given
- Find all angles of a given triangle
- Find all angles of a triangle in 3D
- Find other two sides and angles of a right angle triangle
- Maximum area of quadrilateral
- Check whether the triangle is valid or not if angles are given
- Check if a triangle of positive area is possible with the given angles
- Exterior angle of a cyclic quadrilateral when the opposite interior angle is given
- Count of obtuse angles in a circle with 'k' equidistant points between 2 given points
- Program to find sum of 1 + x/2! + x^2/3! +...+x^n/(n+1)!
- Program to find the sum of a Series 1/1! + 2/2! + 3/3! + 4/4! +.......+ n/n!
- Program to find sum of series 1 + 1/2 + 1/3 + 1/4 + .. + 1/n
- Program to find GCD or HCF of two numbers
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.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.