view artifacts/src/main/java/org/dive4elements/river/artifacts/math/Distance.java @ 5859:a3cd78333185

Removed obsolete imports.
author Sascha L. Teichmann <teichmann@intevation.de>
date Sun, 28 Apr 2013 13:45:22 +0200
parents 5aa05a7a34b7
children 4897a58c8746
line wrap: on
line source
package org.dive4elements.river.artifacts.math;

/** Helper to calculate distance(s). */
public final class Distance {
    /** Return distance between two values. */
    public static double distance(double a, double b) {
        return Math.abs(a - b);
    }

    /** Return whether a and be are within a certain distance. */
    public static boolean within(double a, double b, double threshold) {
        return distance(a, b) <= threshold;
    }
}
// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org