SDL_sin(3)

πŸ’– SDL_sin(3) πŸ’–

okay so bestie, you're in the SDL3 FUNCTIONS section of the manual, and today's main character is... sine πŸ¦‹βœ¨


✨ NAME ✨

SDL_sin β€” compute the sine of x. that's it, that's the whole vibe πŸ’…


🌸 SYNOPSIS 🌸

#include <SDL3/SDL_stdinc.h>

double SDL_sin(double x);

πŸŽ€ DESCRIPTION πŸŽ€

okay so, the domain situation: -INF <= x <= INF β€” like, anything goes in there, no cap.

and the range: -1 <= y <= 1 β€” it always comes back with a number between -1 and 1, periodt. πŸ‘‘

this one is double-precision floating point, okay? if you want single-precision floats, you want SDL_sinf instead. don't mix them up bestie, i'm serious 🫢

⚠️ and here's the tea: 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 like... don't go around assuming it's bit-identical everywhere, because it is not. πŸ’€

🧚 FUNCTION PARAMETERS 🧚

  • x β€” floating point value, in radians. yes, radians, not degrees. i know. we've all been there πŸ™ˆ

⭐ RETURN VALUE ⭐

Returns sine of x. slay. ✨


🌈 THREAD SAFETY 🌈

It is safe to call this function from any thread. no drama, no locks, just vibes. πŸ’œ


πŸ’« AVAILABILITY πŸ’«

This function is available since SDL 3.2.0. if your SDL is older than that, it's giving... nothing, honestly. 😭


πŸ‘‘ SEE ALSO πŸ‘‘


and that's the whole page, bestie!! this one came to you from the Simple Directmedia Layer girlies, running SDL 3.4.18 β€” so go forth, compute your sines, stay in your range, and remember: radians only πŸ’…βœ¨πŸŽ€πŸ¦‹πŸŒΈπŸ’–

πŸ“¦ where this page comes from