You are given three points a, b, c on a page. Find if it’s possible to rotate the page around the point by an angle, such that the new position of ‘a’ is same as the old position of ‘b’, and the new position of ‘b’ is same as the old position of ‘c’. If such angle exists print “Yes”, else “No”.
Input : a1 = 0, a2 = 1, b1 = 1, b2 = 1, c1 = 1, c2 = 0 Output : Yes Explanation : Rotate the page by 90 degree. Input : a1 = 1, a2 = 1, b1 = 0, b2 = 0, c1 = 1000, c2 = 1000 Output : No
Rotation of page by some angle is only possible if the distance between points ‘a’ and ‘b’ is equal to distance between points ‘b’ and ‘c’. But if the points are on same line, there is no rotation at point ‘b’. The problem has no solution when ‘a’, ‘b’, ‘c’ are in the same line or dis(a, b) != dis(b, c)
This article is contributed by Sachin Bisht. 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.
- 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
- Find other two sides of a right angle triangle
- Find other two sides and angles of a right angle triangle
- Program to find the Interior and Exterior Angle of a Regular Polygon
- 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
- Arc length from given Angle
- Angle between two Planes in 3D
- Check if it is possible to create a polygon with a given angle
- Area of a largest square fit in a right angle triangle
- Maximum number of squares that can fit in a right angle isosceles triangle
- Rotate a Matrix by 180 degree
- Length of the chord of the circle whose radius and the angle subtended at the center by the chord is given
Improved By : jit_t