#include <nitro/fx/fx_trig.h>
fx16 FX_SinIdx( int idx ); The argument equates 1 to the value of 2π radian divided by 65,536. The function returns the result as an fx16 type based on a lookup in an internal 4,096-element table. Be aware that the error will become very large near 0 and π. The argument must take a value between 0 - 65535.
The argument is the int type, so in order to make the negative numbers and the numbers larger than 65536 to wrap around to be between 0 and 65536, it needs to be cast explicitly to an u16 type or masked by 0xffff.
idx |
The number of units with a value of 2π radians divided by 65536. |
Approximation of the sine.
FX_CosIdx, FX_SinFx64c, FX_CosFx64c
06/16/2004 Initial Version