Macros | Functions
qwt_math.h File Reference
#include "qwt_global.h"
#include <cmath>
Include dependency graph for qwt_math.h:

Go to the source code of this file.

Macros

#define _USE_MATH_DEFINES
 
#define M_1_PI   ( 0.31830988618379067154 )
 
#define M_2_PI   ( 0.63661977236758134308 )
 
#define M_2_SQRTPI   ( 1.12837916709551257390 )
 
#define M_E   ( 2.7182818284590452354 )
 
#define M_LN10   ( 2.30258509299404568402 )
 
#define M_LN2   ( 0.69314718055994530942 )
 
#define M_LOG10E   ( 0.43429448190325182765 )
 
#define M_LOG2E   ( 1.4426950408889634074 )
 
#define M_PI   ( 3.14159265358979323846 )
 
#define M_PI_2   ( 1.57079632679489661923 )
 
#define M_PI_4   ( 0.78539816339744830962 )
 
#define M_SQRT1_2   ( 0.70710678118654752440 )
 
#define M_SQRT2   ( 1.41421356237309504880 )
 
#define undef_USE_MATH_DEFINES
 

Functions

int qwtCeil (qreal value)
 
double qwtCubicPolynomial (double x, double a, double b, double c, double d)
 
double qwtDegrees (double degrees)
 Translate radians into degrees. More...
 
double qwtFastAtan (double x)
 Approximation of arc tangent ( error below 0,005 radians ) More...
 
double qwtFastAtan2 (double y, double x)
 Approximation of arc tangent ( error below 0,005 radians ) More...
 
int qwtFloor (qreal value)
 
int qwtFuzzyCompare (double value1, double value2, double intervalSize)
 Compare 2 values, relative to an interval. More...
 
QWT_CONSTEXPR double qwtMaxF (double a, double b)
 
QWT_CONSTEXPR qreal qwtMaxF (double a, float b)
 
QWT_CONSTEXPR qreal qwtMaxF (float a, double b)
 
QWT_CONSTEXPR float qwtMaxF (float a, float b)
 
QWT_CONSTEXPR double qwtMinF (double a, double b)
 
QWT_CONSTEXPR qreal qwtMinF (double a, float b)
 
QWT_CONSTEXPR qreal qwtMinF (float a, double b)
 
QWT_CONSTEXPR float qwtMinF (float a, float b)
 
QWT_EXPORT double qwtNormalizeDegrees (double degrees)
 Normalize an angle to be int the range [0.0, 360.0[. More...
 
QWT_EXPORT double qwtNormalizeRadians (double radians)
 Normalize an angle to be int the range [0.0, 2 * PI[. More...
 
double qwtRadians (double degrees)
 Translate degrees into radians. More...
 
QWT_EXPORT quint32 qwtRand ()
 Uses QRandomGenerator for Qt >= 5.10 and qRand() otherwise. More...
 
int qwtSign (double x)
 Return the sign. More...
 
double qwtSqr (double x)
 Return the square of a number. More...
 

Macro Definition Documentation

◆ _USE_MATH_DEFINES

#define _USE_MATH_DEFINES

Definition at line 24 of file qwt_math.h.

◆ M_1_PI

#define M_1_PI   ( 0.31830988618379067154 )

Definition at line 68 of file qwt_math.h.

◆ M_2_PI

#define M_2_PI   ( 0.63661977236758134308 )

Definition at line 72 of file qwt_math.h.

◆ M_2_SQRTPI

#define M_2_SQRTPI   ( 1.12837916709551257390 )

Definition at line 76 of file qwt_math.h.

◆ M_E

#define M_E   ( 2.7182818284590452354 )

Definition at line 36 of file qwt_math.h.

◆ M_LN10

#define M_LN10   ( 2.30258509299404568402 )

Definition at line 52 of file qwt_math.h.

◆ M_LN2

#define M_LN2   ( 0.69314718055994530942 )

Definition at line 48 of file qwt_math.h.

◆ M_LOG10E

#define M_LOG10E   ( 0.43429448190325182765 )

Definition at line 44 of file qwt_math.h.

◆ M_LOG2E

#define M_LOG2E   ( 1.4426950408889634074 )

Definition at line 40 of file qwt_math.h.

◆ M_PI

#define M_PI   ( 3.14159265358979323846 )

Definition at line 56 of file qwt_math.h.

◆ M_PI_2

#define M_PI_2   ( 1.57079632679489661923 )

Definition at line 60 of file qwt_math.h.

◆ M_PI_4

#define M_PI_4   ( 0.78539816339744830962 )

Definition at line 64 of file qwt_math.h.

◆ M_SQRT1_2

#define M_SQRT1_2   ( 0.70710678118654752440 )

Definition at line 84 of file qwt_math.h.

◆ M_SQRT2

#define M_SQRT2   ( 1.41421356237309504880 )

Definition at line 80 of file qwt_math.h.

◆ undef_USE_MATH_DEFINES

#define undef_USE_MATH_DEFINES

Definition at line 25 of file qwt_math.h.

Function Documentation

◆ qwtCeil()

int qwtCeil ( qreal  value)
inline

The same as qCeil, but avoids including qmath.h

Returns
Ceiling of value.

Definition at line 266 of file qwt_math.h.

◆ qwtCubicPolynomial()

double qwtCubicPolynomial ( double  x,
double  a,
double  b,
double  c,
double  d 
)
inline

Definition at line 244 of file qwt_math.h.

◆ qwtDegrees()

double qwtDegrees ( double  degrees)
inline

Translate radians into degrees.

Definition at line 257 of file qwt_math.h.

◆ qwtFastAtan()

double qwtFastAtan ( double  x)
inline

Approximation of arc tangent ( error below 0,005 radians )

Definition at line 201 of file qwt_math.h.

◆ qwtFastAtan2()

double qwtFastAtan2 ( double  y,
double  x 
)
inline

Approximation of arc tangent ( error below 0,005 radians )

Definition at line 213 of file qwt_math.h.

◆ qwtFloor()

int qwtFloor ( qreal  value)
inline

The same as qFloor, but avoids including qmath.h

Returns
Floor of value.

Definition at line 275 of file qwt_math.h.

◆ qwtFuzzyCompare()

int qwtFuzzyCompare ( double  value1,
double  value2,
double  intervalSize 
)
inline

Compare 2 values, relative to an interval.

Values are "equal", when : $\cdot value2 - value1 <= abs(intervalSize * 10e^{-6})$

Parameters
value1First value to compare
value2Second value to compare
intervalSizeinterval size
Returns
0: if equal, -1: if value2 > value1, 1: if value1 > value2

Definition at line 170 of file qwt_math.h.

◆ qwtMaxF() [1/4]

QWT_CONSTEXPR double qwtMaxF ( double  a,
double  b 
)
inline
Returns
Maximum of a and b.

Definition at line 133 of file qwt_math.h.

◆ qwtMaxF() [2/4]

QWT_CONSTEXPR qreal qwtMaxF ( double  a,
float  b 
)
inline
Returns
Maximum of a and b.

Definition at line 145 of file qwt_math.h.

◆ qwtMaxF() [3/4]

QWT_CONSTEXPR qreal qwtMaxF ( float  a,
double  b 
)
inline
Returns
Maximum of a and b.

Definition at line 139 of file qwt_math.h.

◆ qwtMaxF() [4/4]

QWT_CONSTEXPR float qwtMaxF ( float  a,
float  b 
)
inline
Returns
Maximum of a and b.

Definition at line 127 of file qwt_math.h.

◆ qwtMinF() [1/4]

QWT_CONSTEXPR double qwtMinF ( double  a,
double  b 
)
inline
Returns
Minimum of a and b.

Definition at line 109 of file qwt_math.h.

◆ qwtMinF() [2/4]

QWT_CONSTEXPR qreal qwtMinF ( double  a,
float  b 
)
inline
Returns
Minimum of a and b.

Definition at line 121 of file qwt_math.h.

◆ qwtMinF() [3/4]

QWT_CONSTEXPR qreal qwtMinF ( float  a,
double  b 
)
inline
Returns
Minimum of a and b.

Definition at line 115 of file qwt_math.h.

◆ qwtMinF() [4/4]

QWT_CONSTEXPR float qwtMinF ( float  a,
float  b 
)
inline
Returns
Minimum of a and b.

Definition at line 103 of file qwt_math.h.

◆ qwtNormalizeDegrees()

QWT_EXPORT double qwtNormalizeDegrees ( double  degrees)

Normalize an angle to be int the range [0.0, 360.0[.

Parameters
radiansAngle in degrees
Returns
Normalized angle in degrees

Definition at line 35 of file qwt_math.cpp.

◆ qwtNormalizeRadians()

QWT_EXPORT double qwtNormalizeRadians ( double  radians)

Normalize an angle to be int the range [0.0, 2 * PI[.

Parameters
radiansAngle in radians
Returns
Normalized angle in radians

Definition at line 20 of file qwt_math.cpp.

◆ qwtRadians()

double qwtRadians ( double  degrees)
inline

Translate degrees into radians.

Definition at line 251 of file qwt_math.h.

◆ qwtRand()

QWT_EXPORT quint32 qwtRand ( )

Uses QRandomGenerator for Qt >= 5.10 and qRand() otherwise.

Returns
A 32-bit random quantity

Definition at line 48 of file qwt_math.cpp.

◆ qwtSign()

int qwtSign ( double  x)
inline

Return the sign.

Definition at line 184 of file qwt_math.h.

◆ qwtSqr()

double qwtSqr ( double  x)
inline

Return the square of a number.

Definition at line 195 of file qwt_math.h.



plotjuggler
Author(s): Davide Faconti
autogenerated on Mon Nov 11 2024 03:23:49