In the diagram angle AOB=60 degrees and point P lies inside the angle. Line segments PA and PB are drawn so they are perpendicular to the two rays forming angle O as shown. Given OA=a and OB=b find the distance OP in terms of a and b.
Let d = OP. Then cos POA = a/d and cos POB = b/d, so POA = acos(a/d) and POB = acos(b/d).
You can then write cos(acos(a/d) + acos(b/d)) = cos(60) = 1/2.
Since cos(x + y) = cos(x) cos(y) - sin(x) sin(y), you can then plug into this formula to solve for d.