1fixtan(3) Allegro manual fixtan(3)
2
3
4
6 fixtan - Fixed point tangent of binary angles. Allegro game programming
7 library.
8
10 #include <allegro.h>
11
12
13 fixed fixtan(fixed x);
14
16 This function finds the tangent of a value using a lookup table. The
17 input value must be a fixed point binary angle. Example:
18
19 fixed angle, res_a, res_b;
20 float dif;
21
22 angle = itofix(37);
23 /* Prove that tan(angle) == sin(angle) / cos(angle). */
24 res_a = fixdiv(fixsin(angle), fixcos(angle));
25 res_b = fixtan(angle);
26 dif = fixtof(fixsub(res_a, res_b));
27 allegro_message("Precision error: %f\n", dif);
28
30 Returns the tangent of a fixed point binary format angle. The return
31 value will be in radians.
32
33
35Allegro version 4.2.2 fixtan(3)