Advertisement
Guest User

Untitled

a guest
Mar 20th, 2019
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. public double getAngle(Point prePoint, Point mPoint, Point nextPoint) {
  2. DefaultGeographicCRS crs = DefaultGeographicCRS.WGS84;
  3. GeodeticCalculator calc = new GeodeticCalculator(crs);
  4. calc.setStartingGeographicPoint(prePoint.getX(), prePoint.getY());
  5. calc.setDestinationGeographicPoint(mPoint.getX(), mPoint.getY());
  6. double azimuth1 = calc.getAzimuth();
  7. calc.setDestinationGeographicPoint(nextPoint.getX(), nextPoint.getY());
  8.  
  9. double azimuth2 = calc.getAzimuth();
  10. double angle =azimuth2-azimuth1;
  11. return angle;
  12. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement