I have two coordinates which represent the mouse position with respect to the center of the screen ([0, 0] meaning the center, y increases downwards).
So, [0, 0] is one corner of the triangle, and mousePos is another. Now, the position of the mouse should determine the direction of of a small sprite representing the player (in radians).
When the mousePos is, say, [0, -100], right above the player (remember, y increases downwards), then the players direction is 0. When it's [100, 0], right to the player, the direction should be PI/2.
How do I get this? I know how to do it in a very long way, which would be very inefficient for the computer. What is the standard way of computing the angle?