next up previous contents index
Next: Functions for Triang2d Up: Utility Functions Previous: General Utility Macros

Math Utility Functions

 

These basic functions are supplied for compatibility reasons because the parameter and return types and even the names of the basic math functions are not standardized. There exists single and double precision versions of these functions, they are implemented as macros if possible.

double g_sqrt (double x)
float g_sqrtf (float x)

double g_fabs (double x)
float g_fabsf (float x)

double g_pow (double x, double y)
float g_powf (float x, float y)

double g_cos (double x)
float g_cosf (float x)

double g_sin (double x)
float g_sinf (float x)

double g_tan (double x)
float g_tanf (float x)

double g_acos (double x)
float g_acosf (float x)

double g_asin (double x)
float g_asinf (float x)

double g_atan (double x)
float g_atanf (float x)

double g_atan2 (double y, double x)
float g_atan2f (float y, float x)

double g_floor (double x)
float g_floorf (float x)

double g_fmod (double x, double y)
float g_fmodf (float x, float y)

double g_ceil (double x)
float g_ceilf (float x)

double g_exp (double x)
float g_expf (float x)

double g_log (double x)
float g_logf (float x)

double g_log10 (double x)
float g_log10f (float x)

Additionally to these basic math functions some other functions are provided:

void g_check_bounds (double *t, double a, double b)
corrects t to the nearest point within the interval [a, b]

int g_circle (VEC3 m, VEC3 u, VEC3 p, VEC3 q, double t, VEC3 *res)
calculates a point on the circular arc around m from p to q where u defines the plane's normal, the resulting point is returned in res

int g_gcd (int m, int n)
gives the greatest common divisor for the integers m and n

int g_helix (VEC3 a, VEC3 b, VEC3 p, VEC3 q, double t, VEC3 *res)
calculates a point on the helix from p to q with axes a and b, the resulting point is returned in res


next up previous contents index
Next: Functions for Triang2d Up: Utility Functions Previous: General Utility Macros

SFB 256 Universität Bonn and IAM Universität Freiburg

Copyright © by the Sonderforschungsbereich 256 at the Institut für Angewandte Mathematik, Universität Bonn.