QGIS API Documentation
4.3.0-Master (16eddb2670e)
Toggle main menu visibility
Loading...
Searching...
No Matches
src
core
qgsmathutils.h
Go to the documentation of this file.
1
/***************************************************************************
2
qgsmathutils.h
3
----------------------
4
begin : July 2025
5
copyright : (C) 2025 by Nyall Dawson
6
email : nyall dot dawson at gmail dot com
7
***************************************************************************
8
* *
9
* This program is free software; you can redistribute it and/or modify *
10
* it under the terms of the GNU General Public License as published by *
11
* the Free Software Foundation; either version 2 of the License, or *
12
* (at your option) any later version. *
13
* *
14
***************************************************************************/
15
16
#include "qgis_core.h"
17
#include "
qgis_sip.h
"
18
#include "
qgsrange.h
"
19
20
#include <QObject>
21
22
#ifndef QGSMATHUTILS_H
23
#define QGSMATHUTILS_H
24
30
class
CORE_EXPORT
QgsMathUtils
31
{
32
Q_GADGET
33
34
public
:
44
Q_INVOKABLE
static
void
doubleToRational
(
double
value, qlonglong &numerator
SIP_OUT
, qlonglong &denominator
SIP_OUT
,
double
tolerance = 1.0e-9,
int
maxIterations = 100 );
45
54
static
double
roundingInterval
(
double
span,
int
divisions = 10 );
55
67
static
QgsDoubleRange
roundedRange
(
const
QgsDoubleRange
&range );
68
};
69
70
#endif
// QGSMATHUTILS_H
QgsDoubleRange
QgsRange which stores a range of double values.
Definition
qgsrange.h:217
QgsMathUtils
Contains utility functions for mathematical operations.
Definition
qgsmathutils.h:31
QgsMathUtils::doubleToRational
static Q_INVOKABLE void doubleToRational(double value, qlonglong &numerator, qlonglong &denominator, double tolerance=1.0e-9, int maxIterations=100)
Converts a double value to a rational fraction.
Definition
qgsmathutils.cpp:25
QgsMathUtils::roundedRange
static QgsDoubleRange roundedRange(const QgsDoubleRange &range)
Expands a range outward to round values, e.g.
Definition
qgsmathutils.cpp:100
QgsMathUtils::roundingInterval
static double roundingInterval(double span, int divisions=10)
Returns a round interval, a power of ten, which splits the given span into at least divisions parts.
Definition
qgsmathutils.cpp:92
qgis_sip.h
SIP_OUT
#define SIP_OUT
Definition
qgis_sip.h:57
qgsrange.h
Generated on
for QGIS API Documentation by
1.17.0