SDL_acos(3)

✨ SDL_acos ✨

okay bestie, welcome to the SDL3 FUNCTIONS corner of the manual, where we're about to get triggy with it πŸ’… this one's all about SDL_acos(3) and honestly? it's giving math girlie main character energy πŸŽ€


🌸 NAME 🌸

SDL_acos β€” compute the arc cosine of x.


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <SDL3/SDL_stdinc.h>

double SDL_acos(double x);

πŸ’– DESCRIPTION πŸ’–

so like, the definition of y = acos(x) is literally x = cos(y). that's it, that's the vibe. 🫢

Domain: -1 <= x <= 1

Range: 0 <= y <= Pi

this function is out here operating on double-precision floating point values, so if you're working with single-precision floats you gotta go use SDL_acosf instead, iykyk ✨

and listen β€” 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. no cap, that's just how it is πŸ™ˆ so don't come for her when your numbers look slightly off on another box, she warned you πŸ’€


🧚 FUNCTION PARAMETERS 🧚

  • x β€” floating point value. that's the one, the only, the input πŸ‘‘

🌈 RETURN VALUE 🌈

Returns arc cosine of x, in radians. periodt. πŸ’…


πŸ”₯ THREAD SAFETY πŸ”₯

It is safe to call this function from any thread. yes bestie, any thread β€” go wild, she's built different 🫢✨


⭐ AVAILABILITY ⭐

This function is available since SDL 3.2.0. so if you're on something older... bestie, upgrade 😭


πŸ‘‘ SEE ALSO πŸ‘‘


and that's the whole page, you ate that πŸ“ mwah πŸ’œ

Simple Directmedia Layer β€” SDL 3.4.18 β€” written by the SDL girlies, delivered to you with love and a lil sparkle βœ¨πŸŽ€πŸ¦‹ bye bestie, go compute some angles πŸ’–

πŸ“¦ where this page comes from