#include "kis_fast_math.h"
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <QtGlobal>
#include <QGlobalStatic>
Go to the source code of this file.
|
| qreal | calcAngle (qreal x, qreal y) |
| |
| qreal | interp (qreal r, qreal a, qreal b) |
| | private functions
|
| |
◆ calcAngle()
| qreal calcAngle |
( |
qreal | x, |
|
|
qreal | y ) |
|
inline |
Definition at line 57 of file kis_fast_math.cpp.
58{
59 static qreal af = kisATanTable->NUM_ATAN_ENTRIES;
60 static int ai = kisATanTable->NUM_ATAN_ENTRIES;
61 static qreal* ATanTable = kisATanTable->ATanTable;
62 qreal di = (
y /
x) * af;
63 int i = (int)(di);
64 if (i >= ai) return ::atan2(y, x);
65 return interp(di - i, ATanTable[i], ATanTable[i+1]);
66}
qreal interp(qreal r, qreal a, qreal b)
private functions
References interp().
◆ interp()
| qreal interp |
( |
qreal | r, |
|
|
qreal | a, |
|
|
qreal | b ) |
|
inline |
◆ MAX_ERROR
| const qreal MAX_ERROR = 0.0001 |
◆ MAX_SECOND_DERIV_IN_RANGE
| const qreal MAX_SECOND_DERIV_IN_RANGE = 0.6495 |