# Direction Cosines of three mutually perpendicular lines form an orthogonal matrix

I was going through a proof about a result in spheres (the sum of squares of intercepts of 3 mutually perpendicular lines from the same point to a sphere is constant), and the direction cosines of the three lines were taken as $$l_1, m_1, n_1$$; $$l_2, m_2, n_2$$ and $$l_3,m_3,n_3$$. Two results were used

(i) $$l_i^2 + m_i^2 + n_i^2 = 1$$, which is clear since they are direction cosines.

(ii) $$l_1l_2 + m_1m_2 + n_1n_2 = 0$$, and similarly two more equations, which is also clear since they are mutually perpendicular this can be proven using the dot product.

(iii) $$l_1m_1 + l_2m_2 + l_3m_3 = 0$$, and similarly for $$l,n$$ and $$m,n$$ taken together. I am unable to prove this.

I saw that a matrix with the dc's of three mutually perpendicular lines as rows forms an orthogonal matrix, which proves (i), (ii) and (iii), but it is not clear to my why it forms an orthogonal matrix or why (iii) holds. Please help!

A $$3 \times 3$$ matrix $$A$$ can be said to be orthogonal if it preserves the dot product, that is, if $$Av \cdot Aw = v \cdot w$$ for all $$v$$, $$w$$, where we regard $$v$$ and $$w$$ as column vectors. Alternatively, $$A$$ can be said to be orthogonal if its inverse is its own transpose, that is, if $$A^{-1} = A^T$$.
That these are equivalent can be seen as follows. The dot product may be written as $$v \cdot w = v^T w$$. So, if $$v \cdot w = Av \cdot Aw$$ for all $$v$$, $$w$$, then $$v^T w = v^T (A^T A)w$$ for all $$v$$, $$w$$. This is true if and only if $$A^T A = I_3$$, that is, if $$A^T=A^{-1}$$.
If you form the matrix $$A$$ using the direction cosines as columns, then $$A$$ is seen to be orthogonal using your (i) and (ii) to verify $$A^T A = I_3$$. Further, it must also be true that $$AA^T = AA^{-1} = I_3$$, which implies your (iii).
More generally, any $$n \times n$$ matrix whose columns are $$n$$ linearly independent, mutually orthogonal unit vectors is orthogonal, and satisfies equations analogous to your (i), (ii), and (iii).