1fixcos(3) Allegro manual fixcos(3)
2
3
4
6 fixcos - Fixed point cosine of binary angles. Allegro game programming
7 library.
8
10 #include <allegro.h>
11
12
13 fixed fixcos(fixed x);
14
16 This function finds the cosine of a value using a lookup table. The
17 input value must be a fixed point binary angle. Example:
18
19 fixed angle;
20 float result;
21
22 /* Set the binary angle to 45 degrees. */
23 angle = itofix(32);
24 /* The cosine of 45 degrees is about 0.7071. */
25 result = fixtof(fixcos(angle));
26 ASSERT(result > 0.7 && result < 0.71);
27
29 Returns the cosine of a fixed point binary format angle. The return
30 value will be in radians.
31
32
34 , ex12bit(3), ex3buf(3), exblend(3), excustom(3), exspline(3), exup‐
35 date(3)
36
37
38
39Allegro version 4.2.3 fixcos(3)