SDL_cos(3)
π SDL_cos π
okay bestie, welcome to the SDL3 FUNCTIONS corner of the manual, where we're gonna talk about SDL_cos β yes, the trigonometry girlies are THRIVING today π
β¨ NAME β¨
SDL_cos β compute the cosine of x. that's it. that's the whole job. and she does it flawlessly π
β¨ SYNOPSIS β¨
#include <SDL3/SDL_stdinc.h>
double SDL_cos(double x);
like. look at her. so clean. so simple. no notes π
β¨ DESCRIPTION β¨
okay so first things first, the domain and the range, because we respect boundaries in this house π«Ά
- Domain:
-INF <= x <= INF - Range:
-1 <= y <= 1
so like, you can throw literally any real number at her β even the absurdly huge ones β and she'll hand you back something cozy between -1 and 1. that's the vibe check. she always passes it. π
she operates on double-precision floating point values, so if you're out here working with single-precision floats, you want her sister SDL_cosf instead. iykyk β¨
π¨ okay important tea, do NOT skip this: this function may use a different approximation across different versions, platforms and configurations. meaning she can return a different value given the same input on different machines, different operating systems, or if SDL gets updated. so likeβ¦ don't be out here comparing her results across devices expecting them to match exactly, because she said what she said π
β¨ FUNCTION PARAMETERS β¨
xβ a floating point value, in radians. (radians bestie, not degrees. i know. i know. we've all been there π)
β¨ RETURN VALUE β¨
she returns the cosine of x. that's the whole thing. no hidden surprises, no secret second return value, no plot twist. just cosine. iconic behavior honestly β
β¨ THREAD SAFETY β¨
it is safe to call this function from any thread. literally any of them. all your threads. simultaneously. she does not care, she does not fold under pressure, she is built different π§
β¨ AVAILABILITY β¨
this function has been available since SDL 3.2.0. so if you're on anything older, bestieβ¦ it's giving not yet π
β¨ SEE ALSO β¨
the whole trig friend group, obviously π
and that's the page!! π¦ this little beauty comes to you courtesy of Simple Directmedia Layer, living her best life in SDL 3.4.18 πΈ go compute some cosines, bestie, you've got this. periodt. π β¨
π¦ 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