Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public double getAngle(Point prePoint, Point mPoint, Point nextPoint) {
- DefaultGeographicCRS crs = DefaultGeographicCRS.WGS84;
- GeodeticCalculator calc = new GeodeticCalculator(crs);
- calc.setStartingGeographicPoint(prePoint.getX(), prePoint.getY());
- calc.setDestinationGeographicPoint(mPoint.getX(), mPoint.getY());
- double azimuth1 = calc.getAzimuth();
- calc.setDestinationGeographicPoint(nextPoint.getX(), nextPoint.getY());
- double azimuth2 = calc.getAzimuth();
- double angle =azimuth2-azimuth1;
- return angle;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement