al_fixtan(3alleg5)
π al_fixtan: tangent bestie π
okay so this is al_fixtan(3alleg5), from the Allegro 5 API. We're doing fixed point trig and we're doing it fabulously. π
β¨ NAME β¨
al_fixtanβ Allegro 5 API
πΈ SYNOPSIS πΈ
#include <allegro5/allegro.h>
al_fixed al_fixtan(al_fixed x);
π DESCRIPTION π
okay so this function finds the tangent of a value using a lookup table. The input value must be a fixed point binary angle. no cap. β¨
Example:
al_fixed angle, res_a, res_b;
float dif;
angle = al_itofix(37);
/* Prove that tan(angle) == sin(angle) / cos(angle). */
res_a = al_fixdiv(al_fixsin(angle), al_fixcos(angle));
res_b = al_fixtan(angle);
dif = al_fixtof(al_fixsub(res_a, res_b));
printf("Precision error: %f\n", dif);
β RETURN VALUE β
It returns the tangent of a fixed point binary format angle as a fixed point value. periodt. π
Signed, sealed, slayed: this came from the Allegro reference manual, page al_fixtan(3alleg5). The footer didn't hand me a date, so bestie, no date to spill. π
π¦ where this page comes from
- debian trixie: allegro5-doc 2:5.2.10.1+dfsg-1 Β· Zlib
- ubuntu questing: allegro5-doc 2:5.2.10.1+dfsg-1build1
- ubuntu resolute: allegro5-doc 2:5.2.11.3+dfsg-1 Β· Zlib
- ubuntu stonking: allegro5-doc 2:5.2.11.3+dfsg-1 Β· Zlib
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms