Getting players position relative to another

Is it possible to check to see what direction one player is in relative to where the other is facing. For example, if a player is behind another relative to the direction they are facing, is it possible to check for that.

you can check the orientation. If they are facing away then the orientation of the players heads should line up within a set amount of degrees.

if they were facing each other than the orientation of the players would be opposite