fixtorad_r(3alleg4)

πŸ’– fixtorad_r πŸ’–

okay bestie, welcome to the fixtorad_r page of the Allegro manual β€” yes it's a whole manual, yes it's a game programming library, yes you're gonna slay it. this one's a tiny little constant with big main character energy. let's go 🫢


✨ NAME ✨

fixtorad_r β€” a constant that converts angles in fixed point format to radians. it lives in the Allegro game programming library. that's it. that's the whole gig. iconic. πŸ’…


🌸 SYNOPSIS 🌸

#include <allegro.h>

extern const fixed fixtorad_r;

πŸ¦‹ DESCRIPTION πŸ¦‹

so here's the tea, bestie: this constant is literally just a ratio. that's it. but the way that ratio works?? you take a fixed point number that's chillin' in binary angle format, and you use fixtorad_r to turn it into a fixed point number in radians. vibe check passed. βœ…

like, look at this example, it's giving tutorial:

fixed rad_angle, binary_angle;
/* Set the binary angle to 90 degrees. */
binary_angle = 64;
/* Now convert to radians (about 1.57). */
rad_angle = fixmul(binary_angle, fixtorad_r);

so you set the binary angle to 64 (that's 90 degrees, no cap), and then you run it through fixmul with fixtorad_r and boom πŸ’₯ β€” you got radians, which is about 1.57. ate. πŸ”₯

fr fr, notice how you don't add or subtract this constant β€” you fixmul with it. it's a ratio, not a correction. iykyk.

πŸŽ€ SEE ALSO πŸŽ€


Allegro, version 4.4.3 β€” mwah πŸ’‹ thanks for reading my lil page, go convert some angles, you got this πŸŒˆβ­πŸ’œ