fixcos(3alleg4)
πΈ fixcos β bestie edition π
okay so this is fixcos(3alleg4), from the Allegro manual, and it lives in the Allegro game programming library. it's literally a cosine function but make it fixed point. let's go π¦
β¨ NAME β¨
fixcos β fixed point cosine of binary angles. Allegro game programming library. periodt π
β¨ SYNOPSIS β¨
#include <allegro.h>
fixed fixcos(fixed x);
like yes that's the whole thing, she's compact π
β¨ DESCRIPTION β¨
so fixcos finds the cosine of a value, and the way it does that is with a lookup table</c> β not me being efficient, i just am π
. the one thing you MUST remember: the input value has to be a fixed point binary angle. that's non-negotiable bestie, no cap.
example time, look at this:
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);
see how itofix(32) is the binary angle for 45 degrees? and then fixtof converts the fixed result back into a float so we can actually vibe with it? and the ASSERT is just checking it lands between 0.7 and 0.71 because cos(45Β°) β 0.7071. slay π₯
β¨ RETURN VALUE β¨
it returns the cosine of a fixed point binary format angle. and the return value will be in radians. yep. that's what the docs say. i don't make the rules π
β¨ SEE ALSO β¨
- (the first entry here is literally blank in the original β empty slot, ghost link, iconic glitch π)
ex12bit(3alleg4)ex3buf(3alleg4)exblend(3alleg4)excustom(3alleg4)exspline(3alleg4)exupdate(3alleg4)
and that's the whole page bestie, no crumbs left π Allegro, version 4.4.3 β this one's fixcos(3alleg4), mwah ππβ¨
π¦ 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