| 1 |
/**************************************************************************** |
| 2 |
** |
| 3 |
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). |
| 4 |
** All rights reserved. |
| 5 |
** Contact: Nokia Corporation (qt-info@nokia.com) |
| 6 |
** |
| 7 |
** This file is part of the documentation of the Qt Toolkit. |
| 8 |
** |
| 9 |
** $QT_BEGIN_LICENSE:FDL$ |
| 10 |
** GNU Free Documentation License |
| 11 |
** Alternatively, this file may be used under the terms of the GNU Free |
| 12 |
** Documentation License version 1.3 as published by the Free Software |
| 13 |
** Foundation and appearing in the file included in the packaging of |
| 14 |
** this file. |
| 15 |
** |
| 16 |
** Other Usage |
| 17 |
** Alternatively, this file may be used in accordance with the terms |
| 18 |
** and conditions contained in a signed written agreement between you |
| 19 |
** and Nokia. |
| 20 |
** |
| 21 |
** |
| 22 |
** |
| 23 |
** |
| 24 |
** $QT_END_LICENSE$ |
| 25 |
** |
| 26 |
****************************************************************************/ |
| 27 |
|
| 28 |
/*! |
| 29 |
\headerfile <QtCore/qmath.h> |
| 30 |
\title Math Functions |
| 31 |
\ingroup funclists |
| 32 |
\brief The <QtCore/qmath.h> header provides various math functions. |
| 33 |
\pagekeywords math trigonometry qmath floor ceiling absolute sine cosine tangent inverse tan exponent power natural logarithm |
| 34 |
*/ |
| 35 |
|
| 36 |
/*! |
| 37 |
\fn int qCeil(qreal v) |
| 38 |
Return the ceiling of the value \a v. |
| 39 |
|
| 40 |
The ceiling is the smallest integer that is not less than \a v. |
| 41 |
For example, if \a v is 41.2, then the ceiling is 42. |
| 42 |
|
| 43 |
\relates <QtCore/qmath.h> |
| 44 |
\sa qFloor() |
| 45 |
*/ |
| 46 |
|
| 47 |
/*! |
| 48 |
\fn int qFloor(qreal v) |
| 49 |
Return the floor of the value \a v. |
| 50 |
|
| 51 |
The floor is the largest integer that is not greater than \a v. |
| 52 |
For example, if \a v is 41.2, then the floor is 41. |
| 53 |
|
| 54 |
\relates <QtCore/qmath.h> |
| 55 |
\sa qCeil() |
| 56 |
*/ |
| 57 |
|
| 58 |
/*! |
| 59 |
\fn qreal qFabs(qreal v) |
| 60 |
Returns the absolute value of \a v as a qreal. |
| 61 |
*/ |
| 62 |
|
| 63 |
/*! |
| 64 |
\fn qreal qSin(qreal v) |
| 65 |
Returns the sine of the angle \a v in radians. |
| 66 |
|
| 67 |
\relates <QtCore/qmath.h> |
| 68 |
\sa qCos(), qTan() |
| 69 |
*/ |
| 70 |
|
| 71 |
/*! |
| 72 |
\fn qreal qCos(qreal v) |
| 73 |
Returns the cosine of an angle \a v in radians. |
| 74 |
|
| 75 |
\relates <QtCore/qmath.h> |
| 76 |
\sa qSin(), qTan() |
| 77 |
*/ |
| 78 |
|
| 79 |
/*! |
| 80 |
\fn qreal qTan(qreal v) |
| 81 |
Returns the tangent of an angle \a v in radians. |
| 82 |
|
| 83 |
\relates <QtCore/qmath.h> |
| 84 |
\sa qSin(), qCos() |
| 85 |
*/ |
| 86 |
|
| 87 |
/*! |
| 88 |
\fn qreal qAcos(qreal v) |
| 89 |
Returns the arccosine of \a v as an angle in radians. |
| 90 |
Arccosine is the inverse operation of cosine. |
| 91 |
|
| 92 |
\relates <QtCore/qmath.h> |
| 93 |
\sa qAtan(), qAsin(), qCos() |
| 94 |
*/ |
| 95 |
|
| 96 |
/*! |
| 97 |
\fn qreal qAsin(qreal v) |
| 98 |
Returns the arcsine of \a v as an angle in radians. |
| 99 |
Arcsine is the inverse operation of sine. |
| 100 |
|
| 101 |
\relates <QtCore/qmath.h> |
| 102 |
\sa qSin(), qAtan(), qAcos() |
| 103 |
*/ |
| 104 |
|
| 105 |
/*! |
| 106 |
\fn qreal qAtan(qreal v) |
| 107 |
Returns the arctangent of \a v as an angle in radians. |
| 108 |
Arctangent is the inverse operation of tangent. |
| 109 |
|
| 110 |
\relates <QtCore/qmath.h> |
| 111 |
\sa qTan(), qAcos(), qAsin() |
| 112 |
*/ |
| 113 |
|
| 114 |
/*! |
| 115 |
\fn qreal qAtan2(qreal x, qreal y) |
| 116 |
Returns the arctangent of a point specified by the coordinates \a x and \a y. |
| 117 |
This function will return the angle and its direction. |
| 118 |
|
| 119 |
\relates <QtCore/qmath.h> |
| 120 |
\sa qAtan() |
| 121 |
*/ |
| 122 |
|
| 123 |
/*! |
| 124 |
\fn qreal qSqrt(qreal v) |
| 125 |
Returns the square root of \a v. |
| 126 |
This function returns a NaN if \a v is a negative number. |
| 127 |
|
| 128 |
\relates <QtCore/qmath.h> |
| 129 |
\sa qPow() |
| 130 |
*/ |
| 131 |
|
| 132 |
/*! |
| 133 |
\fn qreal qLn(qreal v) |
| 134 |
Returns the natural logarithm of \a v. Natural logarithm uses base e. |
| 135 |
|
| 136 |
\relates <QtCore/qmath.h> |
| 137 |
\sa qExp() |
| 138 |
*/ |
| 139 |
|
| 140 |
/*! |
| 141 |
\fn qreal qExp(qreal v) |
| 142 |
Returns the exponential function of \c e to the power of \a v. |
| 143 |
|
| 144 |
\relates <QtCore/qmath.h> |
| 145 |
\sa qLn() |
| 146 |
*/ |
| 147 |
|
| 148 |
/*! |
| 149 |
\fn qreal qPow(qreal x, qreal y) |
| 150 |
Returns the value of \a x raised to the power of \a y. |
| 151 |
That is, \a x is the base and \a y is the exponent. |
| 152 |
|
| 153 |
\relates <QtCore/qmath.h> |
| 154 |
\sa qSqrt() |
| 155 |
*/ |