al_fixacos(3alleg5)

πŸ“¦
version 5.2.11.3 Β· 4 versions
, in debian trixie, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’– al_fixacos β€” Allegro 5 API πŸ’–

okay bestie, welcome to the al_fixacos page from the Allegro 5 manual (that's the 3alleg5 section, iykyk) πŸŽ€


✨ SYNOPSIS ✨

#include <allegro5/allegro.h>

al_fixed al_fixacos(al_fixed x);

🌸 DESCRIPTION 🌸

so like. this function finds the inverse cosine of a value, and it does it with a lookup table (she's efficient like that πŸ’…). the input has to be a fixed point value, no exceptions.

here's the tea though: inverse cosine is only defined in the domain from -1 to 1. that's it, that's the whole range. if you go outside that input range, the function will set Allegro's errno to EDOM and return zero. so like, it's not gonna crash on you, it's just gonna be disappointed πŸ™ˆ

bestie, keep your input between -1 and 1 or you're getting EDOM and a big fat zero. no cap. πŸ’€

Example:

al_fixed result;

/* Sets result to binary angle 128. */
result = al_fixacos(al_itofix(-1));

⭐ RETURN VALUE ⭐

Returns the inverse sine of a fixed point value, measured as a fixed point binary format angle, or zero if the input was out of range. πŸ¦‹

and listen, every single return value of this function will be in the range 0 to 128 β€” that's the whole vibe check, it always lands in there. periodt. πŸ‘‘


that's the whole page, bestie!! go forth and cosine (inverse-ly) πŸ’œ

mwah πŸ’‹ β€” this was the Allegro reference manual, page al_fixacos(3alleg5), signing off 🫢

πŸ“¦ where this page comes from