Skip to content

Commit

Permalink
Corrected error in Javadoc for interp methods. Val is a value between…
Browse files Browse the repository at this point in the history
… min and max, not 0.0 and 1.0.
  • Loading branch information
chrisnf committed Mar 30, 2009
1 parent c705aca commit f286a46
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions src/prefuse/util/MathLib.java
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public static double safeSqrt(double x) {
* {@link prefuse.Constants#LOG_SCALE},
* {@link prefuse.Constants#SQRT_SCALE}, or
* {@link prefuse.Constants#QUANTILE_SCALE}.
* @param val the interpolation value, a fraction between 0 and 1.0.
* @param val a value within the distribution
* @param dist a double array describing the distribution of the data.
* For the {@link prefuse.Constants#QUANTILE_SCALE} option, this should
* be a collection of quantile boundaries, as determined by the
Expand Down Expand Up @@ -105,10 +105,11 @@ public static double interp(int scale, double val, double dist[]) {
/**
* Interpolates a value between a given minimum and maximum value using
* a linear scale.
* @param val the interpolation value, a fraction between 0 and 1.0.
* @param val a value between the minimum and maximum
* @param min the minimum value of the interpolation range
* @param max the maximum value of the interpolation range
* @return the resulting interpolated value
* @return the fractional position of the value within the scale,
* a double between 0 and 1.
*/
public static double linearInterp(double val, double min, double max) {
double denominator = (max-min);
Expand All @@ -120,10 +121,11 @@ public static double linearInterp(double val, double min, double max) {
/**
* Interpolates a value between a given minimum and maximum value using
* a base-10 logarithmic scale.
* @param val the interpolation value, a fraction between 0 and 1.0.
* @param val a value between the minimum and maximum
* @param min the minimum value of the interpolation range
* @param max the maximum value of the interpolation range
* @return the resulting interpolated value
* @return the fractional position of the value within the scale,
* a double between 0 and 1.
*/
public static double logInterp(double val, double min, double max) {
double logMin = safeLog10(min);
Expand All @@ -136,10 +138,11 @@ public static double logInterp(double val, double min, double max) {
/**
* Interpolates a value between a given minimum and maximum value using
* a square root scale.
* @param val the interpolation value, a fraction between 0 and 1.0.
* @param val a value between the minimum and maximum
* @param min the minimum value of the interpolation range
* @param max the maximum value of the interpolation range
* @return the resulting interpolated value
* @return the fractional position of the value within the scale,
* a double between 0 and 1.
*/
public static double sqrtInterp(double val, double min, double max) {
double sqrtMin = safeSqrt(min);
Expand Down

0 comments on commit f286a46

Please sign in to comment.