Bsoft  1.9
Bernard's software package
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
trigonometry.h File Reference

Header file for trigonometry functions. More...

Go to the source code of this file.

Macros

#define TRIGPRECISION   1e-14
 

Functions

double bcos (double x)
 Avoid non-zero values for cos(PI/2) and cos(-PI/2). More...
 
double bsin (double x)
 Avoid non-zero values for sin(PI) and sin(-PI). More...
 
double btan (double x)
 Avoid non-zero values for tan(PI) and tan(-PI). ATTENTION: tan function return a bigg value for tan(PI/2) and tan(-PI/2) even if tangent it is not define for these values. More...
 
double bacos (double x)
 Wrapper to avoid NaN's returned from acos. More...
 
double basin (double x)
 Wrapper to avoid NaN's returned from asin. More...
 
double batan2 (double y, double x)
 Sets small values to zero before calling atan2. More...
 

Detailed Description

Header file for trigonometry functions.

Author
Eduardo Sanz-Garcia and Bernard Heymann
Date
Created: 20050908
Modified: 20060201 (BH)

Definition in file trigonometry.h.

Macro Definition Documentation

#define TRIGPRECISION   1e-14

Definition at line 9 of file trigonometry.h.

Function Documentation

double bacos ( double  x)

Wrapper to avoid NaN's returned from acos.

Sets large values to +-1 before calling acos.

Parameters
xvalue.
Returns
double angle in radians.

Definition at line 89 of file trigonometry.cpp.

double basin ( double  x)

Wrapper to avoid NaN's returned from asin.

Sets large values to +-1 before calling asin.

Parameters
xvalue.
Returns
double angle in radians.

Definition at line 105 of file trigonometry.cpp.

double batan2 ( double  y,
double  x 
)

Sets small values to zero before calling atan2.

If x or y is lower than TRIGPRECISION, it is set to zero.

Parameters
xvalue of coordinate in x.
yvalue of coordinate in y.
Returns
double angle in radians.

Definition at line 122 of file trigonometry.cpp.

double bcos ( double  x)

Avoid non-zero values for cos(PI/2) and cos(-PI/2).

If x is aproximately PI/2, or -PI/2: return 0 otherwise: return cos(x)

Parameters
xangle in radians.
Returns
double the cosine of x.

Definition at line 27 of file trigonometry.cpp.

double bsin ( double  x)

Avoid non-zero values for sin(PI) and sin(-PI).

If x is aproximately PI or -PI: return 0 otherwise: return sin(x)

Parameters
xangle in radians.
Returns
double the sine of x.

Definition at line 48 of file trigonometry.cpp.

double btan ( double  x)

Avoid non-zero values for tan(PI) and tan(-PI). ATTENTION: tan function return a bigg value for tan(PI/2) and tan(-PI/2) even if tangent it is not define for these values.

If x is aproximately PI or -PI: return 0 Otherwise: return tan(x)

Parameters
xx represent radians.
Returns
double x the corrected value of tan.

Definition at line 71 of file trigonometry.cpp.