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:
Don’t stop now and take your learning to the next level. Learn all the important concepts of Data Structures and Algorithms with the help of the most trusted course: DSA Self Paced. Become industry ready at a student-friendly price.
- Check if it is possible to create a polygon with given n sides
- Angle between 3 given vertices in a n-sided regular polygon
- Find the angle of Rotational Symmetry of an N-sided regular polygon
- Program to find the Interior and Exterior Angle of a Regular Polygon
- Number of occurrences of a given angle formed using 3 vertices of a n-sided regular polygon
- Exterior angle of a cyclic quadrilateral when the opposite interior angle is given
- Angle between a chord and a tangent when angle in the alternate segment is given
- Check whether two convex regular polygon have same center or not
- How to check if a given point lies inside or outside a polygon?
- Check if the given point lies inside given N points of a Convex Polygon
- Area of Triangle using Side-Angle-Side (length of two sides and the included angle)
- Program to calculate angle on circumference subtended by the chord when the central angle subtended by the chord 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
- Angle subtended by the chord when the angle subtended by another chord of same length is given
- Angle between two Planes in 3D
- Arc length from given Angle
- Angle between a Pair of Lines in 3D
- Angle subtended by an arc at the centre of a circle
- Find other two sides of a right angle triangle
- Find if it's possible to rotate the page by an angle or not.
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.