FPP Directional Attacks

I am working on making a directional attacking system for first person perspective based on the direction the mouse moves while pressing the attack button. I have the left, right, up, and down working but I am unsure how to get the angles working. Top left to bottom right, top right to bottom left, bottom left to top right, bottom right to top left. Any idea on how to implement that?

The end goal is to have the weapon follow the mouse movement, slash in whatever direction the mouse moves. If anyone have any ideas on that, thats the goal.