#include <math.h>
#include <stdlib.h>
#include <stdint.h>
#include <assert.h>
Go to the source code of this file.
|
| static int | dequals_mag (double a, double b, double thresh) |
| static int | isq (int v) |
| static float | fsq (float v) |
| static double | sq (double v) |
| static double | sgn (double v) |
| static float | randf (void) |
| static float | signed_randf (void) |
| static int | irand (int bound) |
| static double | mod2pi_positive (double vin) |
| | Map vin to [0, 2*PI).
|
| static double | mod2pi (double vin) |
| | Map vin to [-PI, PI).
|
| static double | mod2pi_ref (double ref, double vin) |
| | Return vin such that it is within PI degrees of ref.
|
| static double | mod360_positive (double vin) |
| | Map vin to [0, 360).
|
| static double | mod360 (double vin) |
| | Map vin to [-180, 180).
|
| static int | mod_positive (int vin, int mod) |
| static int | theta_to_int (double theta, int max) |
| static int | imin (int a, int b) |
| static int | imax (int a, int b) |
| static int64_t | imin64 (int64_t a, int64_t b) |
| static int64_t | imax64 (int64_t a, int64_t b) |
| static int | iclamp (int v, int minv, int maxv) |
| static double | dclamp (double a, double min, double max) |
| static int | fltcmp (float f1, float f2) |
| static int | dblcmp (double d1, double d2) |
◆ _USE_MATH_DEFINES
| #define _USE_MATH_DEFINES |
◆ to_degrees
◆ to_radians
◆ dblcmp()
| int dblcmp |
( |
double | d1, |
|
|
double | d2 ) |
|
inlinestatic |
◆ dclamp()
| double dclamp |
( |
double | a, |
|
|
double | min, |
|
|
double | max ) |
|
inlinestatic |
◆ dequals_mag()
| int dequals_mag |
( |
double | a, |
|
|
double | b, |
|
|
double | thresh ) |
|
inlinestatic |
◆ fltcmp()
| int fltcmp |
( |
float | f1, |
|
|
float | f2 ) |
|
inlinestatic |
◆ fsq()
◆ iclamp()
| int iclamp |
( |
int | v, |
|
|
int | minv, |
|
|
int | maxv ) |
|
inlinestatic |
◆ imax()
| int imax |
( |
int | a, |
|
|
int | b ) |
|
inlinestatic |
◆ imax64()
| int64_t imax64 |
( |
int64_t | a, |
|
|
int64_t | b ) |
|
inlinestatic |
◆ imin()
| int imin |
( |
int | a, |
|
|
int | b ) |
|
inlinestatic |
◆ imin64()
| int64_t imin64 |
( |
int64_t | a, |
|
|
int64_t | b ) |
|
inlinestatic |
◆ irand()
◆ isq()
◆ mod2pi()
| double mod2pi |
( |
double | vin | ) |
|
|
inlinestatic |
◆ mod2pi_positive()
| double mod2pi_positive |
( |
double | vin | ) |
|
|
inlinestatic |
◆ mod2pi_ref()
| double mod2pi_ref |
( |
double | ref, |
|
|
double | vin ) |
|
inlinestatic |
Return vin such that it is within PI degrees of ref.
◆ mod360()
| double mod360 |
( |
double | vin | ) |
|
|
inlinestatic |
◆ mod360_positive()
| double mod360_positive |
( |
double | vin | ) |
|
|
inlinestatic |
◆ mod_positive()
| int mod_positive |
( |
int | vin, |
|
|
int | mod ) |
|
inlinestatic |
◆ randf()
◆ sgn()
◆ signed_randf()
| float signed_randf |
( |
void | | ) |
|
|
inlinestatic |
◆ sq()
◆ theta_to_int()
| int theta_to_int |
( |
double | theta, |
|
|
int | max ) |
|
inlinestatic |