1al_fixtan(3) al_fixtan(3)
2
3
4
6 al_fixtan - Allegro 5 API
7
9 #include <allegro5/allegro.h>
10
11 al_fixed al_fixtan(al_fixed x);
12
14 This function finds the tangent 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, res_a, res_b;
20 float dif;
21
22 angle = al_itofix(37);
23 /* Prove that tan(angle) == sin(angle) / cos(angle). */
24 res_a = al_fixdiv(al_fixsin(angle), al_fixcos(angle));
25 res_b = al_fixtan(angle);
26 dif = al_fixtof(al_fixsub(res_a, res_b));
27 printf("Precision error: %f\n", dif);
28
30 Returns the tangent of a fixed point binary format angle as a fixed
31 point value.
32
33
34
35Allegro reference manual al_fixtan(3)