We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Sherlock and Geometry
Sherlock and Geometry
Sort by
recency
|
7 Discussions
|
Please Login in order to post a comment
OwO
My approach is to calculate the power of the vertices with respect to circle.
If the points are inside print NO If 2 ouside 1 inside print YES If 1 ouside 2 inside print YES If any 1 is on the circle print YES
If all the points are outside then solve the equation with the circle and check if the root lies between the end points of the line segment. I am getting an error.
finally
this is my code which I wrote in 5-6 hours can someone point out what am i missing because this is really frustrating they have given a testcase and inside that testcase there are 30000 testcases :( instead they should have given 10 seprate testcases :(
I made a stupid error. When triangle lies inside the circle, but touches it by vertex, expectad answer is YES, don't be like me.
The overall idea is to check trivial cases (triangle is fully inside, partly inside - check distances to vertices). Then, to detect touching by side, you can use distance from point to line and previous problem in Geometry section - Jim Beam.