SDL_atanf(3)
π SDL_atanf β bestie edition π
okay so this is a page from the SDL3 FUNCTIONS manual, and we're talking about SDL_atanf. yes it's trig, no you don't have to be scared, i got you π«Ά
β¨ NAME β¨
SDL_atanf β Compute the arc tangent of x. that's it, that's the whole job π
β¨ SYNOPSIS β¨
#include <SDL3/SDL_stdinc.h>
float SDL_atanf(float x);
β¨ DESCRIPTION β¨
so like, the definition of y = atan(x) is x = tan(y). they're literally the same statement wearing different outfits π«
- Domain:
-INF <= x <= INF - Range:
-Pi/2 <= y <= Pi/2
this one operates on single-precision floating point values, bestie. if you need the double-precision version, go use SDL_atan for dboule-precision floats. (yes, i said it exactly like that, iykyk π)
and if what you actually want is the arc tangent of y / x? that's a different girl, use SDL_atan2f πΈ
β οΈ important vibe check: this function may use a different approximation across different versions, platforms and configurations. i.e, it can return a different value given the same input on different machines or operating systems, or if SDL is updated. so no cap, don't assume it's bit-identical everywhere. it is not. π
β¨ FUNCTION PARAMETERS β¨
xβ floating point value. that's the one and only thing she asks for π
β¨ RETURN VALUE β¨
Returns arc tangent of of x in radians, or 0 if x = 0. zero in, zero out, iconic behavior fr fr β¨
β¨ THREAD SAFETY β¨
It is safe to call this function from any thread. periodt. call it from all of them at once, she does not care π
β¨ AVAILABILITY β¨
This function is available since SDL 3.2.0. if your SDL is older than that, she's not there yet, sorry bestie π
β¨ SEE ALSO β¨
Simple Directmedia Layer made this, SDL 3.4.18 is the version, and this lil page is dated SDL_atanf(3) β thanks for reading my ted talk, go compute some angles ππ¦β¨
π¦ where this page comes from
- fedora 43: SDL3-devel 3.4.18-1.fc43 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 43: SDL3-devel 3.4.18-1.fc43 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 44: SDL3-devel 3.4.18-1.fc44 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 44: SDL3-devel 3.4.18-1.fc44 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms