Home || Architecture || Video Search || Visual Search || Scripts || Applications || Important Messages || OGL || Src

double Impala::Application::TagsLife::TagsWeekPlot::findStep ( double  min,
double  max,
double &  newMin,
double &  newMax 
) [inline, private]

Definition at line 298 of file TagsWeekPlot.h.

Referenced by AddToHistogram(), and findStep().

00298                                                                             {
00299         double range = max - min;
00300         if(range < 0) range *= -1;
00301         double exponent = floor(log10(range));
00302         double coefficient = range/pow(10, exponent);
00303 
00304         double step = 1;
00305         if(coefficient <= 5) {
00306                 step = 0.5;
00307                 if(coefficient <= 2.5) {
00308                         step = 0.25;
00309                         if(coefficient == 1) step = 0.1;
00310                 }
00311         }
00312 
00313         step *= pow(10, exponent);
00314         if(step == 2.5) step = 2;
00315 
00316         newMin = floor(min/step)*step;
00317         newMax = ceil(max/step)*step;
00318 
00319         if(min > max) return -step;
00320         return step;
00321     }


Generated on Fri Mar 19 10:51:56 2010 for ImpalaSrc by  doxygen 1.5.1