public double calcAzimuth(Instruction nextI) {
        double nextLat;
        double nextLon;

        if (points.getSize() >= 2) {
            nextLat = points.getLatitude(1);
            nextLon = points.getLongitude(1);
        } else if (nextI != null && points.getSize() == 1) {
            nextLat = nextI.points.getLatitude(0);
            nextLon = nextI.points.getLongitude(0);
        } else {
            return Double.NaN;
        }

        double lat = points.getLatitude(0);
        double lon = points.getLongitude(0);
        return AC.calcAzimuth(lat, lon, nextLat, nextLon);
    }
public double calcAzimuth ( Instruction nextI ) { double nextLat ; double nextLon ; if ( points . getSize ( ) >= 2 ) { nextLat = points . getLatitude ( 1 ) ; nextLon = points . getLongitude ( 1 ) ; } else if ( nextI != null && points . getSize ( ) == 1 ) { nextLat = nextI . points . getLatitude ( 0 ) ; nextLon = nextI . points . getLongitude ( 0 ) ; } else { return Double . NaN ; } double lat = points . getLatitude ( 0 ) ; double lon = points . getLongitude ( 0 ) ; return AC . calcAzimuth ( lat , lon , nextLat , nextLon ) ; }
Return the azimuth in degree based on the first tracksegment of this instruction. If this
instruction contains less than 2 points then NaN will be returned or the specified
instruction will be used if that is the finish instruction.