I am making a $2D$ game where an enemy shoots a fireball at the player.
Both the player and the enemy have $(x, y)$ positions and are capable of facing in $8$ directions: UP, DOWN, LEFT, RIGHT, UPPER_RIGHT, UPPER_LEFT, LOWER_LEFT, LOWER_RIGHT.
Let's say the enemy's position is $(130, 100)$ and the player's position is $(145, 106)$. Based on those numbers, I know that I would want the enemy to shoot the fireball in the RIGHT direction because that is his best bet at hitting the player.
But how can I determine this using simple math? How can I determine which of the $8$ directions the enemy should shoot the fireball based on the $(x, y)$ coordinates?