When point is inside of circle Let we have points $A_1,A_2,A_3,A_4$.In time $t$ point $A_i$ has coordinates $(x_i,y_i) + (v_{xi},v_{yi}) * t$, all parametrs are given. Describe algorithm to find all $t$ when point $A_4$ inside circle circumscribed around $A_1,A_2,A_3$ , or to find first moment when this happens.
 A: Let $A_i(X_i,Y_i)$ where
$$X_i=x_i+v_{xi}t\quad\text{and}\quad Y_i=y_i+v_{yi}t$$
for $i=1,2,3$ and $4$.
According to MathWorld, the center of the circle passing through three points $(X_1,Y_1),(X_2,Y_2)$ and $(X_3,Y_3)$ is given by
$$\left(-\frac{b}{2a},-\frac{c}{2a}\right)$$
and its radius is given by
$$\sqrt{\frac{b^2+c^2}{4a^2}-\frac da}$$
where
$$a=\begin{vmatrix}
    X_1 & Y_1 & 1 \\
    X_2 & Y_2 & 1 \\
    X_3 & Y_3 & 1 \\
    \end{vmatrix},\ b=-\begin{vmatrix}
    X_1^2+Y_1^2 & Y_1 & 1 \\
    X_2^2+Y_2^2 & Y_2 & 1 \\
    X_3^2+Y_3^2 & Y_3 & 1 \\
    \end{vmatrix},$$
$$c=\begin{vmatrix}
    X_1^2+Y_1^2 & X_1 & 1 \\
    X_2^2+Y_2^2 & X_2 & 1 \\
    X_3^2+Y_3^2 & X_3 & 1 \\
    \end{vmatrix},\ d=-\begin{vmatrix}
    X_1^2+Y_1^2 & X_1 & Y_1 \\
    X_2^2+Y_2^2 & X_2 & Y_2 \\
    X_3^2+Y_3^2 & X_3 & Y_3 \\
    \end{vmatrix}
$$
Therefore, under the conditions
$$a\not=0\quad\text{and}\quad \frac{b^2+c^2}{4a^2}-\frac da\gt 0$$
which are needed in order for such a circle to exist, we have 
$$\begin{align}&\text{$A_4$ is inside the circle}
\\\\&\iff\sqrt{\left(X_4-\left(-\frac{b}{2a}\right)\right)^2+\left(Y_4-\left(-\frac{c}{2a}\right)\right)^2}\le \sqrt{\frac{b^2+c^2}{4a^2}-\frac da}
\\\\&\iff \left(X_4+\frac{b}{2a}\right)^2+\left(Y_4+\frac{c}{2a}\right)^2\le \frac{b^2+c^2}{4a^2}-\frac da
\\\\&\iff X_4^2+\frac{bX_4}{a}+Y_4^2+\frac{cY_4}{a}+\frac da\le 0
\\\\&\iff a^2X_4^2+abX_4+a^2Y_4^2+acY_4+ad\le 0\end{align}$$
The LHS of the last inequality is a sixth degree polynomial on $t$.
A: First,
find the center and radius
of the circle.
Ways to do this
are shown here:
Get the equation of a circle when given 3 points
Then,
find the times
that the line passes through
the circle.
Using vectors,
if the center is at $C$,
the radius is $r$,
and the line is
$A+Bt$,
you want
$|A+Bt-C|
=r$
or
$|A+Bt-C|^2
=r^2$
or
$\begin{array}\\
r^2
&=\sum (A_i-C_i+tB_i)^2\\
&=\sum (D_i+tB_i)^2
\qquad D_i = A_i-C_i\\
&=\sum (D_i^2+2tD_iB_i+t^2B_i^2)\\
&=\sum D_i^2+2t\sum D_iB_i+t^2\sum B_i^2
\end{array}
$
This is a quadratic in $t$
and can be solved
by the standard formula.
The values of $t$
tell when the line
intersects the circle.
In terms of dot products,
the equation for $t$ is
$r^2
=D\cdot D+2tD\cdot B+t^2B\cdot B
$.
