In coordinate geometry of the plane, the angle α between two lines with gradients m1 and m2 is given by
This is obtained from the tan(A−B) formula. In the special cases when m1m2=−1 or when m1 or m2 is infinite, it has to be interpreted as follows: if m1 m2=−1, θ = 90°; if mi is infinite, θ = 90° −|tan−1 mj| where j ≠ i; and if m1 and m2 are both infinite, θ = 0.