World Builder  1.1.0-pre
A geodynamic initial conditions generator
WorldBuilder::FT Namespace Reference

Functions

double fmod (const double x, const double y)
 
double fast_sin_d (const double angle)
 
double sin (const double raw_angle)
 
double cos (const double angle)
 

Detailed Description

This namespace contains some faster but less accurate version of the trigonomic functions and a faster version of the fmod function.

Function Documentation

◆ cos()

double WorldBuilder::FT::cos ( const double  angle)
inline

Fast but less accurate cos function for any angle.

Definition at line 97 of file point.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ fast_sin_d()

double WorldBuilder::FT::fast_sin_d ( const double  angle)
inline

Fast sin function, accurate for values between 0 and pi. The implementation is based on discussion at https://stackoverflow.com/a/6104692.

The accuracy seem good enough for most purposes. The unit test tests in steps of 0.01 from -4 pi to 4 pi and compares against the std sin function and the difference is always smaller than 1.2e-5. If the test is run with intervals of 0.001 then there are 12 entries which are (very slightly) above that (<3e-8) at angles of about -174, -6, 6 and 174.

Definition at line 66 of file point.h.

Here is the caller graph for this function:

◆ fmod()

double WorldBuilder::FT::fmod ( const double  x,
const double  y 
)
inline

Fast version of the fmod function.

Definition at line 45 of file point.h.

Here is the caller graph for this function:

◆ sin()

double WorldBuilder::FT::sin ( const double  raw_angle)
inline

Fast but less accurate sin function for any angle. Implemented by calling fast_sin_d with a mirrored x if needed to forfill the constrained of fast_sin_d to only have values between zero and pi.

Definition at line 81 of file point.h.

Here is the call graph for this function:
Here is the caller graph for this function: