I am working on a game and I am writing an Entity base class. Since many of the entities will behave like particles(2D) I want to use a normal instead of a rotation in degrees. However since I am using OpenGL I need to have the degree of the normal to rotate. What is the fastest way to convert from the normal to degrees and vice versa. I know that I can use trigonometric functions such as atan2 sin cos etc, but I am pretty sure there is a faster method. Any help or direction would be appreciated.

If you’re constrained to two dimensions and you’re trying to convert a directional vector (x, y) to degrees from the x-axis, then
atan2(y, x)is almost definitely going to be your fastest method, unless you’re constraining the possible values of x and y to some pretty trivial cases. To get the degrees from the y-axis, just useatan2(x, y), of course. This angle will be in radians. Multiply by 180/pi to convert to degrees. This should require a trivial amount of time.The figure you’re drawing suggests that
atan2(x, y) * 180 / Math.PIwill give you the results you desire.Don’t be concerned with speed unless you’ve profiled your code and have determined that there is a bottleneck in this calculation (which is unlikely).