If the line segment joining the points A(a,b) and B(c,d) subtends an angle θ at the origin, then cosθ is equal to
ac+bd√(a2+b2)(c2+d2)
Here (AB)2=(a−c)2+(b−d)2(OA)2=(a−0)2+(b−0)2=a2+b2 and (OB)2=c2+d2
In ΔAOB, cosθ=(OA)2+(OB)2−(AB)22OA.OB=a2+b2+c2+d2−(a−c)2+(b−d)22√a2+b2.√c2+d2ac+bd√(a2+b2)(c2+d2).