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 firstname.lastname@example.org. 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.
- 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
- 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
- Biggest Reuleaux Triangle within a Square which is inscribed within a Right angle Triangle
- Calculate the angle between hour hand and minute hand
- Find value of (1^n + 2^n + 3^n + 4^n ) mod 5
- Find value of (n^1 + n^2 + n^3 + n^4) mod 5 for given n
- Find the value of max(f(x)) - min(f(x)) for a given F(x)
Improved By : jit_t