Lines Matching refs:position
33 private Position centre;
56 this.centre = new Position(0, 0);
132 * @param centre The <code>Position</code> denoting the map's
136 public void setCentre(Position centre) {
161 * Converts a latitude/longitude position into a WU coordinate.
163 * @param position The <code>Position</code> to convert.
167 public Vector3f toWorldUnit(Position position) {
168 // Get the difference between position and the centre for calculating
169 // the position's longitude translation
171 position.getLongitude());
178 position.getLatitude());
183 if (centre.getLatitude() == position.getLatitude()) {
186 if (centre.getLongitude() == position.getLongitude()) {
191 if (centre.getLatitude() > 0 && position.getLatitude() > centre.getLatitude()) {
192 // Centre is north. Position is north of centre
194 } else if (centre.getLatitude() > 0 && position.getLatitude() < centre.getLatitude()) {
195 // Centre is north. Position is south of centre
197 } else if (centre.getLatitude() < 0 && position.getLatitude() > centre.getLatitude()) {
198 // Centre is south. Position is north of centre
200 } else if (centre.getLatitude() < 0 && position.getLatitude() < centre.getLatitude()) {
201 // Centre is south. Position is south of centre
203 } else if (centre.getLatitude() == 0 && position.getLatitude() > centre.getLatitude()) {
204 // Centre is at the equator. Position is north of the equator
206 } else if (centre.getLatitude() == 0 && position.getLatitude() < centre.getLatitude()) {
207 // Centre is at the equator. Position is south of the equator
212 if (centre.getLongitude() < 0 && position.getLongitude() < centre.getLongitude()) {
213 // Centre is west. Position is west of centre
215 } else if (centre.getLongitude() < 0 && position.getLongitude() > centre.getLongitude()) {
216 // Centre is west. Position is south of centre
218 } else if (centre.getLongitude() > 0 && position.getLongitude() < centre.getLongitude()) {
219 // Centre is east. Position is west of centre
221 } else if (centre.getLongitude() > 0 && position.getLongitude() > centre.getLongitude()) {
222 // Centre is east. Position is east of centre
224 } else if (centre.getLongitude() == 0 && position.getLongitude() > centre.getLongitude()) {
225 // Centre is at the equator. Position is east of centre
227 } else if (centre.getLongitude() == 0 && position.getLongitude() < centre.getLongitude()) {
228 // Centre is at the equator. Position is west of centre
237 * Converts a world position into a Mercator position.
242 * @return The resulting <code>Position</code> in degrees of
246 public Position toPosition(Vector3f posVec) {
248 Position pos = null;
250 Vector3f worldCentre = toWorldUnit(new Position(0, 0));
252 // Get the difference between position and the centre
276 pos = new Position(lat, lon);
303 Position newCentre = toPosition(posVec);
323 * Returns the <code>Position</code> centre of the map.
325 * @return <code>Position</code> object marking the map's (lat, long)
329 public Position getCentre() {