3 points always form a triangle.
For a triangle with side lengths $a$, $b$, $c$, the Pythagorean theorem states that if _and only if_ $a^2 + b^2 = c^2$ then the triangle is a right triangle.
* * *
If $a$ is the distance between points $p$ and $q$, with $p = \begin{bmatrix} p_1 \\\ p_2 \\\ p_3 \end{bmatrix}$, and $q = \begin{bmatrix} q_1 \\\ q_2 \\\ q_3 \end{bmatrix}$,
then $$a = |P - Q| = \sqrt{(p_1 - q_1)^2 + (p_2 - q_2)^2 + (p_3 - q_3)^2}$$
so
$$a^2 = (p_1 - q_1)^2 + (p_2 - q_2)^2 + (p_3 - q_3)^2$$