Angle between two lines in space

The formula of angle between two lines in space is:

$$\vec{a}=(a_1,a_2,a_3)$$ ; $$\vec{b}=(b_1,b_2,b_3)$$

$$cos\alpha=\frac{|\vec{a} \vec{b}|}{|\vec{a}||\vec{b}|}$$

or out from there:

$$cos\alpha=\frac{|a_1b_1+a_2b_2+a_3b_3|}{\sqrt{a_1^2+a_2^2+a_3^2}\sqrt{b_1^2+b_2^2+b_3^2}}$$

Why it is $|\vec{a}\vec{b}|$? Why not $\vec{a} \vec{b}$?

Scalar product of two vectors is $$\vec{a}\vec{b}=|\vec{a}||\vec{b}|cos(\vec{a},\vec{b})$$

Last edited:

Because any line contains infinitely many vectors of both directions. The angle between two lines in space can not be greater than $$\pi/2$$

Angle between two vectors belongs to $$[0,\pi]$$.

HallsofIvy
I speak about angle between two lines in the light of measure of mutable position of the lines. More specific, if $$a,b,c,d$$ are lines such that $$a$$ and $$b$$ has intersection point and $$c$$ and $$d$$ has intersection point then $$a\cup b=c\cup d$$ if and only if the angle between $$a$$ and $$b$$ is equal tothe angle between $$c$$ and $$d$$. (Angles are in $$[0,\pi/2]$$.)
If you expect the angle between lines in $$[0,\pi$$, then you can not determine the angle without additional informations (what of four angles determined by the lines etc.).
You can use interval $$[a,b]$$, $$a<b$$ if $$\cos$$ is injective on $$[a,b]$$ and if the image of $$[a,b]$$ under $$\cos$$ is $$[0,1]$$.