Given three angles. The task is to check if it is possible to have a triangle of positive area with these angles. If it is possible print “YES” else print “NO”.
Input : ang1 = 50, ang2 = 60, ang3 = 70 Output : YES Input : ang1 = 50, ang2 = 65, ang3 = 80 Output : NO
Approach: We can form a valid triangle if the below conditions satisfies:
- The sum of the three given angles equals to 180.
- The sum of any two angles is greater than equal to the third one.
- None of the given angles is zero.
Below is the implementation of the above approach:
Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.
To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course.
- Check whether the triangle is valid or not if angles are given
- Length of remaining two sides of a Triangle from a given side and its adjacent angles
- Check if an N-sided Polygon is possible from N given angles
- Find all angles of a triangle in 3D
- Find other two sides and angles of a right angle triangle
- Check whether Quadrilateral is valid or not if angles are given
- Number of possible pairs of Hypotenuse and Area to form right angled triangle
- Python Program to find Sum of Negative, Positive Even and Positive Odd numbers in a List
- Convert angles from degrees to radians for all elements in a given NumPy array
- Find all sides of a right angled triangle from given hypotenuse and area | Set 1
- Find area of triangle if two vectors of two adjacent sides are given
- Area of triangle formed by the axes of co-ordinates and a given straight line
- Area of a Triangle from the given lengths of medians
- Program to find the angles of a quadrilateral
- Sum of internal angles of a Polygon
- Convert angles from radians to degrees in a NumPy array
- Minimum positive integer value possible of X for given A and B in X = P*A + Q*B
- Biggest Reuleaux Triangle within a Square which is inscribed within a Right angle Triangle
- Biggest Reuleaux Triangle inscribed within a Square inscribed in an equilateral triangle
- Program to print a Hollow Triangle inside a Triangle
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.
Improved By : Mithun Kumar