A circle is given with k equidistant points on its circumference. 2 points A and B are given in the circle. Find the count of all obtuse angles (angles larger than 90 degree) formed from /_ACB, where C can be any point in circle other than A or B.
A and B are not equal.
A < B.
Points are between 1 and K(both inclusive).
Input : K = 6, A = 1, B = 3. Output : 1 Explanation : In the circle with 6 equidistant points, when C = 2 i.e. /_123, we get obtuse angle. Input : K = 6, A = 1, B = 4. Output : 0 Explanation : In this circle, there is no such C that form an obtuse angle.
It can be observed that if A and B have equal elements in between them, there can’t be any C such that ACB is obtuse. Also, the number of possible obtuse angles are the smaller arc between A and B.
Below is the implementation :
This article is contributed by Rohit Thapliyal. 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 write comments if you find anything incorrect, or you want to share more information about the topic discussed above.
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.
- Queries on count of points lie inside a circle
- Total number of triplets (A, B, C) in which the points B and C are Equidistant to A
- Circle and Lattice Points
- Equation of circle when three points on the circle are given
- Find N random points within a Circle
- Minimum number of points to be removed to get remaining points on one side of axis
- Check whether it is possible to join two points given on circle such that distance between them is k
- Non-crossing lines to connect points in a circle
- Ways to choose three points with distance between the most distant points <= L
- Angular Sweep (Maximum points that can be enclosed in a circle of given radius)
- Number of quadrilateral formed with N distinct points on circumference of Circle
- Number of Integral Points between Two Points
- Count maximum points on same line
- Count Integral points inside a Triangle
- Count of different straight lines with total n points with m collinear
- Count of Squares that are parallel to the coordinate axis from the given set of N points
- Count of acute, obtuse and right triangles with given sides
- Program to find smallest difference of angles of two parts of a given circle
- Orientation of 3 ordered points
- Number of quadrilaterals possible from the given points