public final class MathHelper
- Object
- MathHelper
Utility class for math operations.
Fields
public static final double NULL_VALUE = -1.7976931348623157E308 | A value that is used a null value. |
Methods
public static double[] minmax(List<Double> values) | Calculate the minimum and maximum values out of a list of doubles. |
public static List<Double> getLabels(double start, double end, int approxNumLabels) | Computes a reasonable set of labels for a data interval and number of labels. |
Inherited methods
Field details
NULL_VALUE
public static final double NULL_VALUE = -1.7976931348623157E308A value that is used a null value.
Method details
minmax
public static double[] minmax(List<Double> values)Calculate the minimum and maximum values out of a list of doubles.
Parameters
valuesList<Double>- the input values
Returns
an array with the minimum and maximum values
getLabels
public static List<Double> getLabels(double start, double end, int approxNumLabels)Computes a reasonable set of labels for a data interval and number of
labels.
Parameters
startdouble- start value
enddouble- final value
approxNumLabelsint- desired number of labels
Returns
collection containing the label values