Concyclic Points
Time Limit: 1 sec
The Problem
In geometry, a set of points are said to be Concyclic (or cocyclic) if they lie on a common circle. All concyclic points are the same distance from the center of the circle. Three points in the plane that do not all fall on a straight line are concyclic, but four or more such points in the plane are not necessarily concyclic.
In the figure P1, P2, P3, P4 points are Concyclic points.
Input will be 4 points of Cartesian coordinates and you have to find this 4 points are Concyclic or not.
The Input
The input will be a single line. The line will contain 8 integer numbers, ( x1, y1), (x2,y2), (x3,y3), (x4,y4) and -101< ( x1, y1), (x2,y2), (x3,y3), (x4,y4) <101 for those input you have to find that the points are Concyclic or not. The points will be clockwise. There (x1, x2, x3, x4) are X-coordinates and (y1, y2, y3, y4) are Y-coordinates. The input will terminate by a line containing (100,-100) (100,-100) (100,-100) (100,-100). This line will not be processed.
The Output
You have to print “YES, POINTS ARE CONCYCLIC” if the inputted Cartesian points are Concyclic and if the inputted Cartesian points are not Concyclic then you have to print “NO, POINTS ARE NOT CONCYCLIC”.
Sample Input
(0,0) (0,6) (6,6) (6,0)
(0,0) (0,6) (10,5) (6,0)
(4,0) (6,0) (8,0) (10,0)
(100,-100) (100,-100) (100,-100) (100,-100)
Sample Output
YES, POINTS ARE CONCYCLIC
NO, POINTS ARE NOT CONCYCLIC
NO, POINTS ARE NOT CONCYCLIC
Intra University Programming Contest - Winter 2019 [BGC Trust University Bangladesh]
Problem Setter: Shahid Mohammed Rokon Uddin Shawon