// Path: app/src/main/java/eu/basicairdata/graziano/gpslogger/GPSApplication.java
// public static final int NOT_AVAILABLE = -100000;


import java.text.SimpleDateFormat;
import java.util.Locale;
import static eu.basicairdata.graziano.gpslogger.GPSApplication.NOT_AVAILABLE;
import android.location.Location;

        if (dresultUp < 0) {
            dresultDown -= dresultUp;
            dresultUp = 0;
        }
        if (dresultDown < 0) {
            dresultUp -= dresultDown;
            //dresultDown = 0;
        }
        return dresultUp;
    }

    /**
     * Returns the estimated descending altitude.
     *
     * @param egmCorrection if true, it estimates the altitude using also the EGM Correction.
     * @return the estimated descending altitude.
     */
    public double getEstimatedAltitudeDown(boolean egmCorrection){
        // Retrieve EGM Corrections if available
        if ((egmAltitudeCorrectionStart == NOT_AVAILABLE) || (egmAltitudeCorrectionEnd == NOT_AVAILABLE)) {
            EGM96 egm96 = EGM96.getInstance();
            if (egm96 != null) {
                if (egm96.isLoaded()) {
                    if (latitudeStart != NOT_AVAILABLE) egmAltitudeCorrectionStart = egm96.getEGMCorrection(latitudeStart, longitudeStart);
                    if (latitudeEnd != NOT_AVAILABLE) egmAltitudeCorrectionEnd = egm96.getEGMCorrection(latitudeEnd, longitudeEnd);
                }
            }
        }
        double egmcorr = 0;
// Path: app/src/main/java/eu/basicairdata/graziano/gpslogger/GPSApplication.java
// public static final int NOT_AVAILABLE = -100000;


// Path: app/src/main/java/eu/basicairdata/graziano/gpslogger/Track.java
import java.text.SimpleDateFormat;
import java.util.Locale;
import static eu.basicairdata.graziano.gpslogger.GPSApplication.NOT_AVAILABLE;
import android.location.Location;


        if (dresultUp < 0) {
            dresultDown -= dresultUp;
            dresultUp = 0;
        }
        if (dresultDown < 0) {
            dresultUp -= dresultDown;
            //dresultDown = 0;
        }
        return dresultUp;
    }

    /**
     * Returns the estimated descending altitude.
     *
     * @param egmCorrection if true, it estimates the altitude using also the EGM Correction.
     * @return the estimated descending altitude.
     */
    public double getEstimatedAltitudeDown(boolean egmCorrection){
        // Retrieve EGM Corrections if available
        if ((egmAltitudeCorrectionStart == NOT_AVAILABLE) || (egmAltitudeCorrectionEnd == NOT_AVAILABLE)) {
            EGM96 egm96 = EGM96.getInstance();
            if (egm96 != null) {
                if (egm96.isLoaded()) {
                    if (latitudeStart != NOT_AVAILABLE) egmAltitudeCorrectionStart = egm96.getEGMCorrection(latitudeStart, longitudeStart);
                    if (latitudeEnd != NOT_AVAILABLE) egmAltitudeCorrectionEnd = egm96.getEGMCorrection(latitudeEnd, longitudeEnd);
                }
            }
        }
        double egmcorr = 0;
        if ((egmCorrection) && ((egmAltitudeCorrectionStart != NOT_AVAILABLE) && (egmAltitudeCorrectionEnd != NOT_AVAILABLE))) {