1al_fixtan(3)               Library Functions Manual               al_fixtan(3)
2
3
4

NAME

6       al_fixtan
7

SYNOPSIS

9              #include <allegro5/allegro.h>
10
11              al_fixed al_fixtan(al_fixed x);
12

DESCRIPTION

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

RETURN VALUE

30       Returns the tangent of a fixed point binary format angle.   The  return
31       value will be in radians.
32
33
34
35Allegro reference manual                                          al_fixtan(3)
Impressum