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