Engauge Digitizer  2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | List of all members
ExportAlignLog Class Reference

Pick first simplest x value between specified min and max, for log scaling. More...

#include <ExportAlignLog.h>

Collaboration diagram for ExportAlignLog:
Collaboration graph

Public Member Functions

 ExportAlignLog (double xMin, double xMax)
 Single constructor. More...
 
double firstSimplestNumber () const
 Result. More...
 

Detailed Description

Pick first simplest x value between specified min and max, for log scaling.

A simplest value is defined here as one having the smallest number of significant digits when log value is taken, and is used for aligning periodic values on simple numbers. Examples:

  1. 0.9 to 2, result is 1 which is 10^0
  2. 1.1 to 9, result is sqrt(10) which is midway between 1 and 10 in log scale, and equal to 10^0.5
  3. 9.81 to 9.93, result is 10^0.992 since 9.81=10^0.99166 and 9.93=10^0.9969

Definition at line 17 of file ExportAlignLog.h.

Constructor & Destructor Documentation

ExportAlignLog::ExportAlignLog ( double  xMin,
double  xMax 
)

Single constructor.

Definition at line 11 of file ExportAlignLog.cpp.

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 }
Pick first simplest x value between specified min and max, for linear scaling.

Member Function Documentation

double ExportAlignLog::firstSimplestNumber ( ) const

Result.

Definition at line 25 of file ExportAlignLog.cpp.

26 {
27  return m_firstSimplestNumber;
28 }

The documentation for this class was generated from the following files: