setting rotation given position?

1st case:

I have parent node and a child node. Child node’s y position is modified like in the image. I want to set the child’s position given a point in space by rotating the parent. How to get the needed Hpr values when given the target x,y,z position?

2nd case:

i want to add cars to my game. Im not going for realism and got almost everything working. The problem is setting the angle of the car on the (uneven) ground. I thought of creating nodes on each wheel and shoot a collision ray from it and set the node’s z position with a collisionHandlerFloor. Now how can I calculate the car’s Hpr angle on the uneven ground given the z positions of the “wheels” each frame?
(If you have a better idea for this case, please tell me).

The lookAt function was designed to do exactly that.

I guess that could work, except for the ypos part. I guess you could do parentnode.getDistance(point) for that one though.