Given an angle where, . The task is to check whether it is possible to make a regular polygon with all of its interior angle equal to . If possible then print “YES”, otherwise print “NO” (without quotes).
Input: angle = 90 Output: YES Polygons with sides 4 is possible with angle 90 degrees. Input: angle = 30 Output: NO
Approach: The Interior angle is defined as the angle between any two adjacent sides of a regular polygon.
It is given by where, n is the number of sides in the polygon.
This can be written as .
On rearranging terms we get, .
Thus, if n is an Integer the answer is “YES” otherwise, answer is “NO”.
Below is the implementation of the above approach:
- Check if it is possible to create a polygon with given n sides
- Program to find the Interior and Exterior Angle of a Regular Polygon
- How to check if a given point lies inside or outside a polygon?
- Angle between two Planes in 3D
- Arc length from given Angle
- Find if it's possible to rotate the page by an angle or not.
- Find other two sides of a right angle triangle
- Program to print binary right angle triangle
- Area of a largest square fit in a right angle triangle
- Find other two sides and angles of a right angle triangle
- Maximum number of squares that can fit in a right angle isosceles triangle
- Find a time for which angle between hour and minute hands is given theta
- Minimum area of a Polygon with three points given
- Area of a polygon with given n ordered vertices
- Minimum Cost Polygon Triangulation
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.