fixacos(3alleg4)
π fixacos β the fixed point inverse cosine lookup table, bestie π
Allegro manual Β· fixacos(3alleg4) Β· a whole function from the Allegro game programming library π
β¨ NAME β¨
fixacos β fixed point inverse cosine lookup table. Allegro game programming library. π¦
πΈ SYNOPSIS πΈ
#include <allegro.h>
fixed fixacos(fixed x);
π DESCRIPTION π
okay so. this function finds the inverse cosine of a value using a lookup table. no cap, it's literally a table lookup. π§
your input value must be a fixed point radian. and listen β inverse cosine is only defined in the domain from -1 to 1. that's it, that's the whole vibe check. if you go outside that input range, the function will set errno to EDOM and return zero. π
example, because we love a demonstration:
fixed result;
/* Sets `result' to binary angle 128. */
result = fixacos(itofix(-1));
π RETURN VALUE π
returns the inverse sine of a fixed point value, measured as fixed point binary format angle, or zero if the input was out of range. (yes, the page says inverse sine β that's what it says, i'm just the messenger π)
all return values of this function will be in the range 0 to 128. every single one. periodt. β
π SEE ALSO π
that's it, bestie β nothing else listed on this one π«Ά
lowkey the whole thing in one breath: radian-ish fixed input,-1to1only, elseerrno=EDOMand you get a zero back. π
Allegro version 4.4.3 Β· fixacos(3alleg4) β mwah, tysm for reading, go slay some fixed point math πβ¨π
π¦ where this page comes from
- debian bookworm: allegro4-doc 2:4.4.3.1-3 Β· Allegro-gift-ware
- debian trixie: allegro4-doc 2:4.4.3.1-5 Β· Allegro-gift-ware
- ubuntu jammy: allegro4-doc 2:4.4.3.1-2 Β· Allegro-gift-ware
- ubuntu noble: allegro4-doc 2:4.4.3.1-4.1build3 Β· Allegro-gift-ware
- ubuntu questing: allegro4-doc 2:4.4.3.1-6
- ubuntu resolute: allegro4-doc 2:4.4.3.1-7 Β· Allegro-gift-ware
- ubuntu stonking: allegro4-doc 2:4.4.3.1-9 Β· Allegro-gift-ware
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms