I'm facing a problem with some ANGLE calculation.
ANGLE is the 16 bit type used by the SGL to store angle values. All values are between 0 and 2*pi, represented by 0x0000 and 0xffff. pi/4 is 0x2000, pi/2 0x4000, etc.
What I want is to compute N interpolations between two angles a1 and a2.
for the interpolation i (i [0..N]), i have the angle a_i
a_i = a1 + i*(a2-a1)/N
The problem lies in the (a2-a1)/N part: As it makes no sens using float or int division, how can I divide the ANGLE value by the integer N ?
Any idea ?
ANGLE is the 16 bit type used by the SGL to store angle values. All values are between 0 and 2*pi, represented by 0x0000 and 0xffff. pi/4 is 0x2000, pi/2 0x4000, etc.
What I want is to compute N interpolations between two angles a1 and a2.
for the interpolation i (i [0..N]), i have the angle a_i
a_i = a1 + i*(a2-a1)/N
The problem lies in the (a2-a1)/N part: As it makes no sens using float or int division, how can I divide the ANGLE value by the integer N ?
Any idea ?