Reading this article on Wikipedia, it gives a way to test whether the 4th point is within the triangle's circumcircle.
$$ \begin{align} & \begin{vmatrix} A_x & A_y & A_x^2 + A_y^2 & 1\\ B_x & B_y & B_x^2 + B_y^2 & 1\\ C_x & C_y & C_x^2 + C_y^2 & 1\\ D_x & D_y & D_x^2 + D_y^2 & 1 \end{vmatrix} = \begin{vmatrix} A_x - D_x & A_y - D_y & (A_x^2 - D_x^2) + (A_y^2 - D_y^2) \\ B_x - D_x & B_y - D_y & (B_x^2 - D_x^2) + (B_y^2 - D_y^2) \\ C_x - D_x & C_y - D_y & (C_x^2 - D_x^2) + (C_y^2 - D_y^2) \end{vmatrix} \\[8pt] = {} & \begin{vmatrix} A_x - D_x & A_y - D_y & (A_x - D_x)^2 + (A_y - D_y)^2 \\ B_x - D_x & B_y - D_y & (B_x - D_x)^2 + (B_y - D_y)^2 \\ C_x - D_x & C_y - D_y & (C_x - D_x)^2 + (C_y - D_y)^2 \end{vmatrix} > 0 \end{align} $$
I can understand goes from the 1st matrix to the 2nd one, but I don't know how come the 2nd goes to 3rd matrix. Means I don't understand how
$ (A_x^2 - D_x^2) + (A_y^2 - D_y^2) $ goes to $(A_x - D_x)^2 + (A_y - D_y)^2 $
$(B_x^2 - D_x^2) + (B_y^2 - D_y^2) $ goes to $(B_x - D_x)^2 + (B_y - D_y)^2$
$(C_x^2 - D_x^2) + (C_y^2 - D_y^2)$ goes to $(C_x - D_x)^2 + (C_y - D_y)^2$.
$(A_x^2 - D_x^2) + (A_y^2 - D_y^2) = A_x^2 + A_y^2 - D_x^2 - D_y^2 = OA^2 - OD^2$, but I don't think $\bigtriangleup OAD$ is a right triangle,would be great if someone can explain this step for me, Thanks in advance.
