Given a n-sided regular polygon and three vertices a1, a2 and a3, the task is to find the angle suspended at vertex a1 by vertex a2 and vertex a3.
Input: n = 6, a1 = 1, a2 = 2, a3 = 4 Output: 90 Input: n = 5, a1 = 1, a2 = 2, a3 = 5 Output: 36
- The angle subtended by an edge on the center of n sided regular polygon is 360/n.
- The angle subtended by vertices seperated by k edges becomes (360*k)/n.
- The chord between the vertices subtends an angle with half the value of the angle subtended at the center at the third vertex which is a point on the circumference on the circumcircle.
- Let the angle obtained in this manner be a = (180*x)/n where k is number of edges between i and k.
- Similarily for the opposite vertex we get the angle to be b = (180*y)/n where l is number of edges between j and k.
- The angle between the three vertices thus equals 180-a-b.
Below is the implementation of the above approach:
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.
- Nth angle of a Polygon whose initial angle and per angle increment is given
- Number of occurrences of a given angle formed using 3 vertices of a n-sided regular polygon
- Program to find the Interior and Exterior Angle of a Regular Polygon
- Central angle of a N sided Regular Polygon
- Find the angle of Rotational Symmetry of an N-sided regular polygon
- Polygon with maximum sides that can be inscribed in an N-sided regular polygon
- Angle between a chord and a tangent when angle in the alternate segment is given
- Angle subtended by the chord when the angle subtended by another chord of same length is given
- 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
- Area of Triangle using Side-Angle-Side (length of two sides and the included angle)
- Find the remaining vertices of a square from two given vertices
- Check if it is possible to create a polygon with a given angle
- Check if given polygon is a convex polygon or not
- Number of ways a convex polygon of n+2 sides can split into triangles by connecting vertices
- Number of triangles formed by joining vertices of n-sided polygon with one side common
- Number of triangles formed by joining vertices of n-sided polygon with two common sides and no common sides
- Number of cycles formed by joining vertices of n sided polygon at the center
- Number of cycles in a Polygon with lines from Centroid to Vertices
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.