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.
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
- 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 between a chord and a tangent when angle in the alternate segment 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)
- Check if it is possible to create a polygon with a given angle
- Find other two sides of a right angle triangle
- Program to find the Interior and Exterior Angle of a Regular Polygon
- Find other two sides and angles of a right angle triangle
- Find the maximum angle at which we can tilt the bottle without spilling any water
- Find the angle of Rotational Symmetry of an N-sided regular polygon
- Find the area of rhombus from given Angle and Side length
- Calculate the angle between hour hand and minute hand
- Maximum number of squares that can fit in a right angle isosceles triangle
- Arc length from given Angle
- Angle between two Planes in 3D
- Area of a largest square fit in a right angle triangle
- Biggest Reuleaux Triangle within a Square which is inscribed within a Right angle Triangle