fixcos(3)
β¨ NAME β¨
okay bestie, welcome to fixcos(3) from the Allegro manual β yes, the Allegro game programming library is in the building. π
fixcosβ Fixed point cosine of binary angles. Part of the Allegro game programming library, periodt.
πΈ SYNOPSIS πΈ
#include <allegro.h>
fixed fixcos(fixed x);
like, you include the header and call fixcos with a fixed value. easy. β¨
π¦ DESCRIPTION π¦
This function finds the cosine of a value using a lookup table. The input value must be a fixed point binary angle. No cap. Example:
fixed angle;
float result;
/* Set the binary angle to 45 degrees. */
angle = itofix(32);
/* The cosine of 45 degrees is about 0.7071. */
result = fixtof(fixcos(angle));
ASSERT(result > 0.7 && result < 0.71);
So you set a binary angle with itofix(32) for 45 degrees, then fixcos it, then fixtof the result, and the assertion checks it's between 0.7 and 0.71. π
π RETURN VALUE π
Returns the cosine of a fixed point binary format angle. The return value will be in radians. So like, even though the input is a binary angle, the answer comes back in radians β don't get it twisted, bestie. π₯
π SEE ALSO π
tiny detail: the original SEE ALSO line has a stray leading comma before ex12bit(3). iconic, honestly. π
that's the whole fixcos(3) page, bestie. source/version: Allegro, version 4.4.3. date: the original footer didn't list one, so no made-up date here β just pure Allegro energy. π«Άπ
π¦ where this page comes from
- fedora 43: allegro-devel 4.4.3.1-18.fc43 Β· Giftware
- fedora 43: allegro-devel 4.4.3.1-18.fc43 Β· Giftware
- fedora 44: allegro-devel 4.4.3.1-20.fc44 Β· Giftware
- fedora 44: allegro-devel 4.4.3.1-20.fc44 Β· Giftware
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms