Re: [Geotools-gt2-users] Azimuth calculation From: Andrea Aime - 2010-04-10 13:36 ```Torgue ha scritto: > Wikipedia: > For example, moving clockwise on a 360° degree circle, a point due east > would have an azimuth of 90°, south 180°, and west 270°. > > Example for a south direction: > > GeodeticCalculator calc = new GeodeticCalculator(); > calc.setStartingGeographicPoint(0,0); > calc.setDestinationGeographicPoint(-1,0); > > double azimuth = calc.getAzimuth(); > > Result: -90.0 but should be 180 The result is correct. The API is clear: /** * Set the destination point in geographic coordinates. The azimuth and distance values * will be updated as a side effect of this call. They will be recomputed the next time * {@link #getAzimuth()} or {@link #getOrthodromicDistance()} are invoked. * * @param longitude The longitude in decimal degrees between -180 and +180° * @param latitude The latgitude in decimal degrees between -90 and +90° * @throws IllegalArgumentException if the longitude or the latitude is out of bounds. * * @since 2.3 */ public void setDestinationGeographicPoint(double longitude, double latitude) throws IllegalArgumentException (-1, 0) is west of (0,0) Cheers Andrea -- Andrea Aime OpenGeo - http://opengeo.org Expert service straight from the developers. ```

 Re: [Geotools-gt2-users] Azimuth calculation From: Andrea Aime - 2010-04-10 13:21 ```Torgue ha scritto: > Hi all, > > I'm trying to calculate some azimuth angle. > > For example > > GeodeticCalculator calc = new GeodeticCalculator(); > calc.setStartingGeographicPoint(0,0); > calc.setDestinationGeographicPoint(1,0); > > double azimuth = calc.getAzimuth(); > > Has a result of 90°, but shouln't it be 0° becaus it in north direction? http://en.wikipedia.org/wiki/Azimuth See the definition of azimuth in navigation Cheers Andrea -- Andrea Aime OpenGeo - http://opengeo.org Expert service straight from the developers. ```
 Re: [Geotools-gt2-users] Azimuth calculation From: Torgue - 2010-04-10 13:27 ```Wikipedia: For example, moving clockwise on a 360° degree circle, a point due east would have an azimuth of 90°, south 180°, and west 270°. Example for a south direction: GeodeticCalculator calc = new GeodeticCalculator(); calc.setStartingGeographicPoint(0,0); calc.setDestinationGeographicPoint(-1,0); double azimuth = calc.getAzimuth(); Result: -90.0 but should be 180 Can you please explain how it works? -- View this message in context: http://n2.nabble.com/Azimuth-calculation-tp4881875p4881906.html Sent from the geotools-gt2-users mailing list archive at Nabble.com. ```
 Re: [Geotools-gt2-users] Azimuth calculation From: Andrea Aime - 2010-04-10 13:36 ```Torgue ha scritto: > Wikipedia: > For example, moving clockwise on a 360° degree circle, a point due east > would have an azimuth of 90°, south 180°, and west 270°. > > Example for a south direction: > > GeodeticCalculator calc = new GeodeticCalculator(); > calc.setStartingGeographicPoint(0,0); > calc.setDestinationGeographicPoint(-1,0); > > double azimuth = calc.getAzimuth(); > > Result: -90.0 but should be 180 The result is correct. The API is clear: /** * Set the destination point in geographic coordinates. The azimuth and distance values * will be updated as a side effect of this call. They will be recomputed the next time * {@link #getAzimuth()} or {@link #getOrthodromicDistance()} are invoked. * * @param longitude The longitude in decimal degrees between -180 and +180° * @param latitude The latgitude in decimal degrees between -90 and +90° * @throws IllegalArgumentException if the longitude or the latitude is out of bounds. * * @since 2.3 */ public void setDestinationGeographicPoint(double longitude, double latitude) throws IllegalArgumentException (-1, 0) is west of (0,0) Cheers Andrea -- Andrea Aime OpenGeo - http://opengeo.org Expert service straight from the developers. ```