Engauge Digitizer  2
ExportAlignLog.cpp
1 /******************************************************************************************************
2  * (C) 2014 markummitchell@github.com. This file is part of Engauge Digitizer, which is released *
3  * under GNU General Public License version 2 (GPLv2) or (at your option) any later version. See file *
4  * LICENSE or go to gnu.org/licenses for details. Distribution requires prior written permission. *
5  ******************************************************************************************************/
6 
7 #include "ExportAlignLinear.h"
8 #include "ExportAlignLog.h"
9 #include <qmath.h>
10 
12  double xMax)
13 {
14  // Convert log numbers to linear numbers
15  double xMinLog = log10 (xMin);
16  double xMaxLog = log10 (xMax);
17 
18  ExportAlignLinear alignLinear (xMinLog,
19  xMaxLog);
20 
21  // Convert result back to log numbers
22  m_firstSimplestNumber = qPow (10.0, alignLinear.firstSimplestNumber());
23 }
24 
26 {
27  return m_firstSimplestNumber;
28 }
29 
30 double ExportAlignLog::log10 (double in) const
31 {
32  return qLn (in) / qLn (10.0);
33 }
Pick first simplest x value between specified min and max, for linear scaling.
double firstSimplestNumber() const
Result.
double firstSimplestNumber() const
Result.
ExportAlignLog(double xMin, double xMax)
Single constructor.