I would like to determine with code (c++ for example) if two 3D vectors are linearly dependent.
I know that if I could determine that the expression $ v_1 = k · v_2 $is true then they are linearly dependent; they are linearly independent otherwise.
I've tried to construct an equation system to determine that, but since there could be zeros anywhere it gets very tricky and could end with divisions by zero and similar.
I've also though about using some matrices/determinants, but since the matrix would look like:
$ \begin{matrix} x_1 & y_1 & z_1\\ x_2 & y_2 & z_2\\ \end{matrix} $
i don't see an easy way to check for the the linear dependency... any ideas?
Thanks!