(Original post by ztibor)
You can use any vectors being parallel to the lines.
The simplest is to use the given direction vectors e.g. a and b,
but if these are unknown you can use any vector 'representing' a
line segment f.e. between points A and C, where A and C are on the
same line. This vector AC maybe considered as direction vector too,
(and using it in a given equation of a line as direction vector, you
have to change only lamdba to an other parameter f.e beta to get the
same vector for the running point of the line)
To calculate the angle between two lines means to calculate it between
the two direction vectors or between the two normal vector, wiches mutually perpendicular to the direction vectors so they have the same angle between each other than it does the direction vectors.
For calculating the angle between two vectors we use the dot product od these vectors. THese product maybe calculated with two methods:
1. From the known coordinates
a(a1,a2,a3) and b(b1,b2,b3) -> a*b=a1*b1+a2*b2+a3*b3=>constant
2. From the given modulus of the vectors and the angle between them
Taking equal the two equations
At the numerator you have to give the dot product from coordinates.
Dividing it by the moduluses gives the cosine of angle.
This means that we calculate the dot product of two unit-length vectors being parallel with the original vectors.