NSMBW-Decomp
A decompilation of New Super Mario Bros. Wii
Loading...
Searching...
No Matches
c_math.hpp
Go to the documentation of this file.
1#pragma once
2#include <types.h>
3/// @file
4
5/// @brief C Math library.
6/// @ingroup clib
7namespace cM {
8
9 // Conversion utilities
10 s16 rad2s(float rad); ///< Converts an angle from radians to units.
11 s16 atan2s(float sin, float cos); ///< Converts a sine and a cosine to an angle in units.
12
13 // RNG utilities
14 void initRnd(ulong seed); ///< Initializes ::s_rnd with the given seed.
15 float rnd(); ///< Generates a floating point number between 0 and 1.
16 int rndInt(int max); ///< Generates an integer between 0 and the given max.
17 float rndF(float max); ///< Generates a floating point number between 0 and the given max.
18
19} // namespace cM
C Math library.
Definition c_math.cpp:94
float rnd()
Generates a floating point number between 0 and 1.
Definition c_math.cpp:176
float rndF(float max)
Generates a floating point number between 0 and the given max.
Definition c_math.cpp:184
int rndInt(int max)
Generates an integer between 0 and the given max.
Definition c_math.cpp:180
s16 atan2s(float sin, float cos)
Converts a sine and a cosine to an angle in units.
Definition c_math.cpp:168
s16 rad2s(float rad)
Converts an angle from radians to units.
Definition c_math.cpp:104
void initRnd(ulong seed)
Initializes s_rnd with the given seed.
Definition c_math.cpp:172