All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.formulasearchengine.mathmltools.similarity.distances.earthmover.Feature2D Maven / Gradle / Ivy

There is a newer version: 2.0.5
Show newest version
package com.formulasearchengine.mathmltools.similarity.distances.earthmover;

/**
 * @author Telmo Menezes ([email protected])
 */
public class Feature2D implements Feature {
    private double x;
    private double y;

    public Feature2D(double x, double y) {
        this.x = x;
        this.y = y;
    }

    public double groundDist(Feature f) {
        Feature2D f2d = (Feature2D) f;
        double deltaX = x - f2d.x;
        double deltaY = y - f2d.y;
        return Math.sqrt((deltaX * deltaX) + (deltaY * deltaY));
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy