PROBLEM LINK:
DIFFICULTY:
HARD
PREREQUISITES:
Circumcenter
Quadratic Equations
Basic Geometry
PROBLEM:
Given two circles in 3 dimensions (denoted using 3 points on each circle) find whether they are entangled or not.
EXPLANATION:
Finding circumcenter of a circle given 3 pts on that circle >
Let three points be A,B,C
Now, make two vectors AB(joining A and B) and AC(similarly)
ABP > perpendicular bisectors of AB
ACP > perpendicular bisectors of AC
Circumcenter would be meeting point of ABP and ACP
Now translate the axis to center of first circle.
Rotate the axis in such a manner that first circle comes in xyplane.
Now get the plane of second circle in the form ax+by+cz=d
We can get the line of intersection of this plane with xy plane(plane of first circle) by putting z=0.
So now intersecting line becomes ax+by=d;
Now first circle is centered at origin in xy plane;
So equation of first circle will be x^2 + y^2 = r^2 ;
Now we have to find the intersection of this circle and the intersecting line.
We will be getting a quadratic equation on solving this>

imaginary roots > line doesn’t intersect the first circle[Not possible]. Two rings can’t entangle because plane of second ring doesn’t intersect first(ring in xy plane) ring.

equal roots > first circle intersect plane of second circle at only one point[Not Possible]. We have been given both rings don’t touch each other, therefore if first ring only touches the second plane, its not possible to entangle.

distinct roots >
Let a,b are the two points that came from solving the equations of first circle and second plane. For entangling two rings > one point(a,b) should lie inside the second ring and other should lie outside the second ring.
RELATED PROBLEMS:
CODE
setter.cpp
By Sukhjashan Singh