Slope of line 1 = (y12 - y11)/(x12 - x11) = tan A1
Slope of line 2 = (y22 - y21)/(x22 - x21) = tan A2
Here (x1i, y1i) and (x2i,y2i), i=1,2 are any two points on lines 1 and 2.
Need A2 - A1.
tan (A2 - A1) = (tan A2 - tan A1) / ( 1 + tan A2 tan A1)
So the answer is
A2 - A1 = arctan (tan A2 - tan A1) / (1 + tan A2 tan A1)
Actually it is much simpler to work with the "homogeneous coordinates" of projective geometry. Then the angle can be calculated as a logarithm of the "cross ratio" of four lines - the two lines you are given and two imaginary "ideal" lines that connect the intersection point of the given lines with the two "circular points at infinity". The angle is then
A = i log XR(L1, L2, I1, I2)
The tangents etc. that appear above are the reduction of this formula for a specific coordinate system.
It really pays to learn projective ideas if you're going to do computational geometry.