2 Copyright (C) 2001, 2006 United States Government
3 as represented by the Administrator of the
4 National Aeronautics and Space Administration.
7 package gov
.nasa
.worldwind
.geom
;
9 import gov
.nasa
.worldwind
.*;
13 * @version $Id: Position.java 1755 2007-05-06 23:38:05Z tgaskins $
17 private final Angle latitude
;
18 private final Angle longitude
;
19 private final double elevation
;
21 public static final Position ZERO
= new Position(Angle
.ZERO
, Angle
.ZERO
, 0d
);
23 public static Position
fromRadians(double latitude
, double longitude
, double elevation
)
25 return new Position(Angle
.fromRadians(latitude
), Angle
.fromRadians(longitude
), elevation
);
28 public static Position
fromDegrees(double latitude
, double longitude
, double elevation
)
30 return new Position(Angle
.fromDegrees(latitude
), Angle
.fromDegrees(longitude
), elevation
);
33 public Position(Angle latitude
, Angle longitude
, double elevation
)
35 if (latitude
== null || longitude
== null)
37 String message
= WorldWind
.retrieveErrMsg("nullValue.LatitudeOrLongitudeIsNull");
38 WorldWind
.logger().log(java
.util
.logging
.Level
.FINE
, message
);
39 throw new IllegalArgumentException(message
);
42 this.latitude
= latitude
;
43 this.longitude
= longitude
;
44 this.elevation
= elevation
;
48 * Obtains the latitude of this position
50 * @return this position's latitude
52 public final Angle
getLatitude()
58 * Obtains the longitude of this position
60 * @return this position's longitude
62 public final Angle
getLongitude()
64 return this.longitude
;
68 * Obtains the elevation of this position
70 * @return this position's elevation
72 public final double getElevation()
74 return this.elevation
;