Press the flag, then move the mouse around. The project will calculate the angle between the center of the screen and your mouse cursor, and draw a line according to that. It's surprisingly accurate, despite being a method I invented myself.
This project calculates the angle between two points (a and b), using the ratio between their x and y distances. Basically, you get the x and y distances right and up respectively (down and left are represented by negatives). Then, get the absolute value of those distances and add them up to get a sum. You can then divide the distances by that sum to get a value between -1 and 1, which are the x and y "ratios". Next, you'll need to tweak the formula for different cases. You can see them in an if statement in the project. Basically for the 4 quarters of a circle you'll need a different starting value, in clockwise order, 0, 90, 180, 270, and to know which value to use you can compare the distances negative and positive states. You convert the ratio from -1 to 1 into a ratio of -90 to 90, but only use the absolute value, so it's actually from 0 to 90. You then add this to the initial value, for example 270 + 90 would be 360, the max you can get before looping back to 0. To get the angle, the formula is: initial_value + ( abs(ratio_x)*90 ) Also, if either of the distances/ratios are negative, but not if both are, you'll need to multiply the y ratio by 90 rather than the x ratio.