Enemy sprite rotation like in Classic Doom

What would the algorithm for determining the enemies orientation in respects to players current position look like. I’m struggling to find a way to translate that kind of information between the enemy sprite and player character.