Package slash.navigation.common

Examples of slash.navigation.common.Bearing


        return other.hasCoordinates() ? calculateDistance(other.getLongitude(), other.getLatitude()) : null;
    }

    public Double calculateDistance(double longitude, double latitude) {
        if (hasCoordinates()) {
            Bearing bearing = calculateBearing(getLongitude(), getLatitude(), longitude, latitude);
            double distance = bearing.getDistance();
            if (!isNaN(distance))
                return distance;
        }
        return null;
    }
View Full Code Here


        return null;
    }

    public Double calculateAngle(NavigationPosition other) {
        if (hasCoordinates() && other.hasCoordinates()) {
            Bearing bearing = calculateBearing(getLongitude(), getLatitude(), other.getLongitude(), other.getLatitude());
            return bearing.getAngle();
        }
        return null;
    }
View Full Code Here

        return null;
    }

    public Double calculateOrthogonalDistance(NavigationPosition pointA, NavigationPosition pointB) {
        if (hasCoordinates() && pointA.hasCoordinates() && pointB.hasCoordinates()) {
            Bearing bearingAD = calculateBearing(pointA.getLongitude(), pointA.getLatitude(), getLongitude(), getLatitude());
            Double distanceAtoD = bearingAD.getDistance();
            if (distanceAtoD != null) {
                double courseAtoD = toRadians(bearingAD.getAngle());
                double courseAtoB = toRadians(pointA.calculateAngle(pointB));
                return asin(sin(distanceAtoD / EARTH_RADIUS) *
                        sin(courseAtoD - courseAtoB)) * EARTH_RADIUS;
            }
        }
View Full Code Here

TOP

Related Classes of slash.navigation.common.Bearing

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.