Angles

Are there any built functions that can tell me what angel an object is relative to another object in world space. for example if I have a planet revolving around a star can I find you what degree the planet is using the 2 axis of the orbital plane. The trig functions only seem to hold up for 90°. If I have Cartesian coordinates can I get an angle.

Thanks

Actually I might have found another solution. When you do a raycast and get normal information the vector is in world space. Does anybody know how to get the normal vector returned in the space of the objects parent?