I have a circle formed with three given points. How can i know whether another given point is inside the circle formed by previous three points. Is it determinant i need to calculate? Then what are the cases i need to handle?
How to know location of a point?
912 Views Asked by user940 https://math.techqa.club/user/user940/detail AtThere are 4 best solutions below
On
Let $A(x_1,y_1),~~B(x_2,y_2),~~C(x_3,y_3)$ are three arbitrary points in $\mathbb R^2$. If you want to check if another give point is in the circle or out of it, you should have the equation of the circle. Let's assume its equation is of the form: $$(x-a)^2+(y-b)^2=r^2$$ and our forth point is $(x_4,y_4)$. If $(x_4-a)^2+(y_4-b)^2>r^2$ so the point is out of the circle and if $<r$ it is in the circle. Can you find the equation of the circle?
On
If you really would like to use determinants to find this, there are ways. For e.g. check http://www-ma2.upc.es/%7Egeoc/circumferenciaEN.pdf for a method (you would first need to know how to check the orientation of the triangle formed by three points, which is yet another determinant).
On
Use complex numbers to represent the points. If $z_1,z_2,z_3$ are the points determining the circle, going around the circle in counterclockwise order, and $z$ is the point you wish to locate as inside or outside of the circle, calculate the cross-ratio $$r = \frac{(z_1-z_3)(z_2-z)}{(z_1-z)(z_2-z_4)}.$$ Then $z$ is inside the circle through $z_1,z_2,z_3$ if $r$ has positive imaginary part, while $z$ is outside the circle if $r$ has negative imaginary part. A point $z$ which is on the circle will give an $r$ with imaginary part $0$.
Of course this assumes $z_1,z_2,z_3$ are not on a line, which your program would presumably ensure. And before calculating $r$, one should check whether $z$ happens to be equal to one of $z_1,z_2,z_3$; the answer is already known in that case, so no loss there.
If it's a problem determining which order is counterclockwise, one out is to first use $z=1000$ or some value known to be outside the circle, and then keep track of the imaginary parts of $r$ calculated using both the sought point $z$ and using $1000$ for $z$. Those $z$ giving the oppositely signed imaginary part will then be inside the circle, etc.
After you calculated the center and the radius you just check if the norm of the center - the point is lower than the radius. If yes, than the poin is in the circle, if not he isn't.