SDL_sinf(3)
β¨ SDL_sinf β¨
okay bestie, welcome to the SDL_sinf page from the SDL3 functions manual π this one's short and sweet and honestly kind of iconic.
πΈ NAME πΈ
SDL_sinf β compute the sine of x. that's it. that's the whole job. slay. π
π SYNOPSIS π
#include <SDL3/SDL_stdinc.h>
float SDL_sinf(float x);
likeβ¦ one line of include, one function. lowkey the cleanest synopsis on the block π«Ά
π¦ DESCRIPTION π¦
okay so here's the vibe check on what this function actually does:
- Domain:
-INF <= x <= INFβ she'll take literally any float you throw at her, no gatekeeping π - Range:
-1 <= y <= 1β but she will NEVER leave that range. that's the rule. the range is the range, periodt β¨
This function operates on single-precision floating point values. if you want the double-precision version, go use SDL_sin instead β that's your girl for doubles. fr fr, don't mix them up π
β οΈ and now for the part you need to hear: 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 do NOT go comparing SDL_sinf output across machines and expecting it to match character for character π it's giving "approximately correct" energy and honestly that's fine for sine.
π§ FUNCTION PARAMETERS π§
xβ floating point value, in radians. (radians!! not degrees!! bestie please, radians π)
π RETURN VALUE π
Returns sine of x. cute, correct, does what it says on the tin β¨
π₯ THREAD SAFETY π₯
It is safe to call this function from any thread. no locks, no drama, no main-character bottleneck β every thread can just have her whenever it wants ππ
β AVAILABILITY β
This function is available since SDL 3.2.0. so if you're on something olderβ¦ girl. upgrade. π«Ά
π SEE ALSO π
SDL_sin(3)β the double-precision one, for when you want more digitsSDL_asinf(3)β arc sine, the reverse vibeSDL_cosf(3)β her bestie that does cosine instead
k that's the whole page!! short, sweet, mathematically sound, no notes π go forth and compute your sines, bestie π¦π
this page is from the SDL 3.4.18 documentation, dated like every good manpage, and it's brought to you by Simple Directmedia Layer β mwah, thanks for reading, ily, bye!! π β¨
π¦ 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