Since the slope is the tangent of the angle the line makes with the x-axis you will need some trig identities.

There is, for example, the sum law: \(\displaystyle tan(A+ B)= \frac{tan(A)+ tan(B)}{1+ tan(A)tan(B)}\) as well as sin(A+ B)= sin(A)cos(B)- cos(A)sin(B) and cos(A+ B)= cos(A)cos(B)- sin(A)sin(B).

Also, \(\displaystyle tan(A/2)= \frac{1- cos(A)}{sin(A)}\).