1al_fixcos(3) al_fixcos(3)
2
3
4
6 al_fixcos - Allegro 5 API
7
9 #include <allegro5/allegro.h>
10
11 al_fixed al_fixcos(al_fixed x);
12
14 This function finds the cosine of a value using a lookup table. The
15 input value must be a fixed point binary angle.
16
17 Example:
18
19 al_fixed angle;
20 float result;
21
22 /* Set the binary angle to 45 degrees. */
23 angle = al_itofix(32);
24
25 /* The cosine of 45 degrees is about 0.7071. */
26 result = al_fixtof(al_fixcos(angle));
27 assert(result > 0.7 && result < 0.71);
28
30 Returns the cosine of a fixed point binary format angle as a fixed
31 point value.
32
33
34
35Allegro reference manual al_fixcos(3)