Why use (360 * 16) instead of 360 degrees?

I noticed this when using Qt, going through code examples.

When they try to set the range for the variable in which the angle is stored (the angle in this case), why is it necessary to multiply 360 by 16 instead of 360?

the code (from the hellogl example) is

static void qNormalizeAngle(int &angle) { while (angle < 0) angle += 360 * 16; while (angle > 360 * 16) angle -= 360 * 16; } 

another example from an example of colloidal lubricant:

 Mouse::Mouse() : angle(0), speed(0), mouseEyeDirection(0), color(qrand() % 256, qrand() % 256, qrand() % 256) { setRotation(qrand() % (360 * 16)); } 

Confession. I have almost no experience in both Qt and graphical programming. Also tell me if this is common everywhere or only in Qt.

+4
source share
1 answer

Buried in this article:

Values ​​are multiplied by 16 because QPainter expresses angles as sixteenth degree.

+5
source

All Articles