#include <math.h>#include <qpoint.h>#include "qwt_global.h"#include "qwt_double_rect.h"Go to the source code of this file.
Defines | |
| #define | qwtMax QMAX |
| #define | qwtMin QMIN |
| #define | qwtAbs QABS |
| #define | LOG10_2 0.30102999566398119802 |
| #define | LOG10_3 0.47712125471966243540 |
| #define | LOG10_5 0.69897000433601885749 |
| #define | M_2PI 6.28318530717958623200 |
| #define | LOG_MIN 1.0e-100 |
| Mininum value for logarithmic scales. | |
| #define | LOG_MAX 1.0e100 |
| Maximum value for logarithmic scales. | |
| #define | M_E 2.7182818284590452354 |
| #define | M_LOG2E 1.4426950408889634074 |
| #define | M_LOG10E 0.43429448190325182765 |
| #define | M_LN2 0.69314718055994530942 |
| #define | M_LN10 2.30258509299404568402 |
| #define | M_PI 3.14159265358979323846 |
| #define | M_PI_2 1.57079632679489661923 |
| #define | M_PI_4 0.78539816339744830962 |
| #define | M_1_PI 0.31830988618379067154 |
| #define | M_2_PI 0.63661977236758134308 |
| #define | M_2_SQRTPI 1.12837916709551257390 |
| #define | M_SQRT2 1.41421356237309504880 |
| #define | M_SQRT1_2 0.70710678118654752440 |
Functions | |
| double | qwtGetMin (const double *array, int size) |
| Find the smallest value in an array. | |
| double | qwtGetMax (const double *array, int size) |
| Find the largest value in an array. | |
| int | qwtSign (double x) |
| Return the sign. | |
| double | qwtSqr (const double x) |
| Return the square of a number. | |
| template<class T > | |
| T | qwtLim (const T &x, const T &x1, const T &x2) |
| Limit a value to fit into a specified interval. | |
| QPoint | qwtPolar2Pos (const QPoint &pole, double radius, double angle) |
| QPoint | qwtDegree2Pos (const QPoint &pole, double radius, double angle) |
| QwtDoublePoint | qwtPolar2Pos (const QwtDoublePoint &pole, double radius, double angle) |
| QwtDoublePoint | qwtDegree2Pos (const QwtDoublePoint &pole, double radius, double angle) |
| double | qwtRound (double value) |
| Rounding of doubles, like qRound for integers. | |
| #define LOG10_2 0.30102999566398119802 |
Definition at line 33 of file qwt_math.h.
| #define LOG10_3 0.47712125471966243540 |
Definition at line 37 of file qwt_math.h.
| #define LOG10_5 0.69897000433601885749 |
Definition at line 41 of file qwt_math.h.
| #define LOG_MAX 1.0e100 |
Maximum value for logarithmic scales.
Definition at line 55 of file qwt_math.h.
Referenced by QwtLog10ScaleEngine::autoScale(), and QwtLog10ScaleEngine::divideScale().
| #define LOG_MIN 1.0e-100 |
Mininum value for logarithmic scales.
Definition at line 50 of file qwt_math.h.
Referenced by QwtLog10ScaleEngine::autoScale(), and QwtLog10ScaleEngine::divideScale().
| #define M_1_PI 0.31830988618379067154 |
Definition at line 91 of file qwt_math.h.
| #define M_2_PI 0.63661977236758134308 |
Definition at line 95 of file qwt_math.h.
| #define M_2_SQRTPI 1.12837916709551257390 |
Definition at line 99 of file qwt_math.h.
| #define M_2PI 6.28318530717958623200 |
Definition at line 45 of file qwt_math.h.
| #define M_E 2.7182818284590452354 |
Definition at line 59 of file qwt_math.h.
| #define M_LN10 2.30258509299404568402 |
Definition at line 75 of file qwt_math.h.
| #define M_LN2 0.69314718055994530942 |
Definition at line 71 of file qwt_math.h.
| #define M_LOG10E 0.43429448190325182765 |
Definition at line 67 of file qwt_math.h.
| #define M_LOG2E 1.4426950408889634074 |
Definition at line 63 of file qwt_math.h.
| #define M_PI 3.14159265358979323846 |
Definition at line 79 of file qwt_math.h.
Referenced by qwtDegree2Pos().
| #define M_PI_2 1.57079632679489661923 |
Definition at line 83 of file qwt_math.h.
Referenced by QwtDialSimpleNeedle::drawArrowNeedle(), QwtDialSimpleNeedle::drawRayNeedle(), QwtSimpleCompassRose::drawRose(), and line2Radians().
| #define M_PI_4 0.78539816339744830962 |
Definition at line 87 of file qwt_math.h.
| #define M_SQRT1_2 0.70710678118654752440 |
Definition at line 107 of file qwt_math.h.
| #define M_SQRT2 1.41421356237309504880 |
Definition at line 103 of file qwt_math.h.
| #define qwtAbs QABS |
Definition at line 22 of file qwt_math.h.
Referenced by QwtScaleEngine::buildInterval(), QwtScaleArithmetic::compareEps(), QwtLog10ScaleEngine::divideScale(), QwtLinearScaleEngine::divideScale(), QwtPicker::drawRubberBand(), QwtWheel::drawWheel(), QwtWheel::drawWheelBackground(), QwtPlotPicker::end(), QwtScaleDraw::getBorderDistHint(), QwtLinearColorMap::ColorStops::insert(), QwtScaleMap::pDist(), QwtPlotMagnifier::rescale(), QwtScaleMap::sDist(), QwtDoubleRange::setRange(), QwtDoubleRange::step(), QwtDoubleInterval::symmetrize(), and QwtMagnifier::widgetWheelEvent().
| #define qwtMax QMAX |
Definition at line 20 of file qwt_math.h.
Referenced by QwtPlotLayout::alignScales(), QwtLog10ScaleEngine::autoScale(), QwtLinearScaleEngine::autoScale(), QwtScaleDiv::contains(), QwtDialSimpleNeedle::drawArrowNeedle(), QwtRoundScaleDraw::drawBackbone(), QwtKnob::drawMarker(), QwtCompassMagnetNeedle::drawPointer(), QwtDialSimpleNeedle::drawRayNeedle(), QwtPicker::drawRubberBand(), QwtCompassMagnetNeedle::drawThinNeedle(), QwtPlotPicker::end(), QwtDoubleSize::expandedTo(), QwtDoubleInterval::extend(), QwtScaleDraw::extent(), QwtRoundScaleDraw::extent(), QwtDoubleRect::intersects(), QwtLegend::layoutContents(), QwtDynGridLayout::layoutGrid(), QwtPlotLayout::layoutLegend(), QwtSlider::layoutSlider(), QwtThermo::layoutThermo(), QwtDoubleInterval::limited(), QwtSlider::minimumSizeHint(), QwtScaleWidget::minimumSizeHint(), QwtPlotLayout::minimumSizeHint(), QwtScaleDraw::minLength(), QwtAbstractSlider::mousePressEvent(), QwtDoubleRect::operator&(), QwtDoubleRect::operator|(), qwtGetMax(), qwtLim(), QwtKnob::setBorderWidth(), QwtLegendItem::setIdentifierWidth(), QwtWheel::setInternalBorder(), QwtKnob::setKnobWidth(), QwtScaleWidget::setMargin(), QwtScaleEngine::setMargins(), QwtDial::setScaleArc(), QwtScaleWidget::setSpacing(), QwtPlotLayout::setSpacing(), QwtLegendItem::setSpacing(), QwtSplineCurveFitter::setSplineSize(), QwtDoubleInterval::symmetrize(), QwtRichTextEngine::textSize(), QwtPicker::trackerRect(), QwtPicker::widgetKeyPressEvent(), and QwtPlotZoomer::zoom().
| #define qwtMin QMIN |
Definition at line 21 of file qwt_math.h.
Referenced by QwtPlotLayout::alignScales(), QwtLog10ScaleEngine::autoScale(), QwtDoubleSize::boundedTo(), QwtDial::boundingRect(), QwtScaleDiv::contains(), QmitkHistogram::draw(), QwtRoundScaleDraw::drawBackbone(), QwtKnob::drawKnob(), QwtPainter::drawPolyline(), QwtScaleDraw::drawTick(), QwtPlotLayout::expandLineBreaks(), QwtDoubleInterval::extend(), QwtPlotLayout::LayoutData::init(), QwtDoubleRect::intersects(), QwtPlotLayout::layoutLegend(), QwtDoubleInterval::limited(), QwtPlotLayout::minimumSizeHint(), QwtDoubleRect::operator&(), QwtDoubleRect::operator|(), qwtGetMin(), qwtLim(), QwtThermo::setBorderWidth(), QwtWheel::setInternalBorder(), QwtDial::setScaleArc(), QwtIntervalData::size(), QwtArrayData::size(), QwtCounter::sizeHint(), QwtPicker::trackerRect(), QwtPicker::widgetKeyPressEvent(), and QwtPlotZoomer::zoom().
| QPoint qwtDegree2Pos | ( | const QPoint & | pole, |
| double | radius, | ||
| double | angle | ||
| ) | [inline] |
Definition at line 165 of file qwt_math.h.
References M_PI, and qwtPolar2Pos().
Referenced by QwtCompassMagnetNeedle::drawPointer(), QwtCompassWindArrow::drawStyle1Needle(), QwtCompassWindArrow::drawStyle2Needle(), and QwtCompassMagnetNeedle::drawTriangleNeedle().
{
return qwtPolar2Pos(pole, radius, angle / 180.0 * M_PI);
}
| QwtDoublePoint qwtDegree2Pos | ( | const QwtDoublePoint & | pole, |
| double | radius, | ||
| double | angle | ||
| ) | [inline] |
Definition at line 180 of file qwt_math.h.
References M_PI, and qwtPolar2Pos().
{
return qwtPolar2Pos(pole, radius, angle / 180.0 * M_PI);
}
| double qwtGetMax | ( | const double * | array, |
| int | size | ||
| ) |
Find the largest value in an array.
| array | Pointer to an array |
| size | Array size |
Definition at line 37 of file qwt_math.cpp.
References qwtMax.
{
if (size <= 0)
return 0.0;
double rv = array[0];
for (int i = 1; i < size; i++)
rv = qwtMax(rv, array[i]);
return rv;
}
| double qwtGetMin | ( | const double * | array, |
| int | size | ||
| ) |
Find the smallest value in an array.
| array | Pointer to an array |
| size | Array size |
Definition at line 19 of file qwt_math.cpp.
References qwtMin.
{
if (size <= 0)
return 0.0;
double rv = array[0];
for (int i = 1; i < size; i++)
rv = qwtMin(rv, array[i]);
return rv;
}
| T qwtLim | ( | const T & | x, |
| const T & | x1, | ||
| const T & | x2 | ||
| ) |
Limit a value to fit into a specified interval.
| x | Input value |
| x1 | First interval boundary |
| x2 | Second interval boundary |
Definition at line 138 of file qwt_math.h.
References qwtMax, and qwtMin.
Referenced by QwtArrowButton::QwtArrowButton(), QwtRoundScaleDraw::setAngleRange(), QwtDoubleRange::setRange(), QwtWheel::setTickCnt(), QwtWheel::setViewAngle(), and verifyRange().
| QwtDoublePoint qwtPolar2Pos | ( | const QwtDoublePoint & | pole, |
| double | radius, | ||
| double | angle | ||
| ) | [inline] |
Definition at line 171 of file qwt_math.h.
References QwtDoublePoint::x(), and QwtDoublePoint::y().
| QPoint qwtPolar2Pos | ( | const QPoint & | pole, |
| double | radius, | ||
| double | angle | ||
| ) | [inline] |
Definition at line 156 of file qwt_math.h.
Referenced by QwtDialSimpleNeedle::drawArrowNeedle(), QwtDialSimpleNeedle::drawRayNeedle(), QwtSimpleCompassRose::drawRose(), and qwtDegree2Pos().
| double qwtRound | ( | double | value ) | [inline] |
Rounding of doubles, like qRound for integers.
Definition at line 187 of file qwt_math.h.
{
return ::floor(value + 0.5); // MSVC has no ::round().
}
| int qwtSign | ( | double | x ) | [inline] |
Return the sign.
Definition at line 115 of file qwt_math.h.
| double qwtSqr | ( | const double | x ) | [inline] |
Return the square of a number.
Definition at line 126 of file qwt_math.h.
Referenced by QwtSpline::buildPeriodicSpline(), and QwtPlotCurve::closestPoint().
1.7.2