Well, I don't know if can get this right, but I will try.
First you have to calculate the distance on x and y (or z) axes, to get the necessary values for a (arc-)tangens calculation
DiffX = EnemyPosX - YourPosX
DiffY = EnemyPosY - YourPosY (Or Z, depending on your point of view)
Rule: tan(alpha) = X / Y and tan(beta) = Y / X
MeToEnemyDegrees_Absolute = tan^-1 * (DiffX / DiffY)
or
EnemyToMeDegrees_Absolute = tan^-1 * (DiffY / DiffX)
To determine if something is behind someone/something, you can do the folllowing: (Not tested)
Code:
public bool IsBehind(GameObject obj)
{
double x = obj.x - this.x;
double y = obj.y - this.y;
double d = Math.Atan() * (y / x); // Absolute rotation "Object to Object"
// If you set your rotation to this value, you will face the object
double r = d - this.RotationZ; // substracting object rotation from absolute rotation
if(Math.Abs(r) > 180) r = (Math.Abs(r) - 360) * -1;
return (r > 90); // If the relative rotation to the object is bigger than 90 degrees,
// the given object is behind "this"
}