Skip to content

Commit

Permalink
Clarify variable name.
Browse files Browse the repository at this point in the history
  • Loading branch information
abrahamwolk committed Jul 11, 2023
1 parent 9d9ce86 commit 2491d0f
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -263,16 +263,16 @@ public static int determinePrecision(final double number)
* <p>This method tries to adjust a computed tick distance
* to one that is hopefully 'nicer'
*
* @param distance Original step distance
* @param min_distance Original step distance
* @return
*/
public static double selectNiceStep(final double distance)
public static double selectNiceStep(final double min_distance)
{
final double log = Math.log10(distance);
final double log = Math.log10(min_distance);
final double order_of_magnitude = Math.pow(10, Math.floor(log));
final double step = distance / order_of_magnitude;
final double step = min_distance / order_of_magnitude;
for (int i=0; i<NICE_STEPS.length; ++i)
if (step >= NICE_THRESHOLDS[i] && NICE_STEPS[i] * order_of_magnitude >= distance)
if (step >= NICE_THRESHOLDS[i] && NICE_STEPS[i] * order_of_magnitude >= min_distance)
return NICE_STEPS[i] * order_of_magnitude;
return step * order_of_magnitude;
}
Expand Down

0 comments on commit 2491d0f

Please sign in to comment.