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

org.opentripplanner.graph_builder.module.extra_elevation_data.ElevationPoint Maven / Gradle / Ivy

There is a newer version: 2.5.0
Show newest version
package org.opentripplanner.graph_builder.module.extra_elevation_data;

public class ElevationPoint implements Comparable {
    public double distanceAlongShape, ele;

    public ElevationPoint(double distance, double ele) {
        this.distanceAlongShape = distance;
        this.ele = ele;
    }

    public ElevationPoint fromBack(double length) {
        return new ElevationPoint(length - distanceAlongShape, ele);
    }

    @Override
    public int compareTo(ElevationPoint arg0) {
        return (int) Math.signum(distanceAlongShape - arg0.distanceAlongShape);
    }
    
    public String toString() {
        return "ElevationPoint(" + distanceAlongShape + ", " + ele + ")";
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy