X-Git-Url: http://wamblee.org/gitweb/?a=blobdiff_plain;f=gps%2Fsrc%2Forg%2Fwamblee%2Fgps%2Fcoordinates%2FReferenceCoordinateSystem.java;fp=gps%2Fsrc%2Forg%2Fwamblee%2Fgps%2Fcoordinates%2FReferenceCoordinateSystem.java;h=0000000000000000000000000000000000000000;hb=e692384298e6463c52e9d0971eb6702287a2995b;hp=f3ed69cb80aa6b7c382a5fb991945ec1f25adb73;hpb=67734685f68cb726a713dbbebdc53017d0ed620c;p=utils diff --git a/gps/src/org/wamblee/gps/coordinates/ReferenceCoordinateSystem.java b/gps/src/org/wamblee/gps/coordinates/ReferenceCoordinateSystem.java deleted file mode 100644 index f3ed69cb..00000000 --- a/gps/src/org/wamblee/gps/coordinates/ReferenceCoordinateSystem.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright 2006 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.wamblee.gps.coordinates; - - -/** - * Reference coordinate system which is the basis for defining metrics. - * This is a Cartesian coordinate system. - */ -public class ReferenceCoordinateSystem implements CoordinateSystem { - - /** - * Constructs the coordinate system. - * - */ - public ReferenceCoordinateSystem() { - // Empty - } - - /* - * (non-Javadoc) - * - * @see org.wamblee.gpx.CoordinateSystem#toReferenceSystem(org.wamblee.gpx.Coordinates) - */ - public Coordinates toReferenceSystem(Coordinates aCoordinates) { - return aCoordinates; - } - - /* - * (non-Javadoc) - * - * @see org.wamblee.gpx.CoordinateSystem#distance(org.wamblee.gpx.Coordinates, - * org.wamblee.gpx.Coordinates) - */ - private static double distance(Coordinates aC1, Coordinates aC2) { - return Math.sqrt(square(aC1.getX1() - aC2.getX1()) - + square(aC1.getX2() - aC2.getX2()) - + square(aC1.getX3() - aC2.getX3())); - } - - private static double square(double x) { - return x * x; - } - - /** - * Computes the distance between two points in arbitrary coordinate systems. - * @param aP1 First point. - * @param aP2 Second point. - * @return Distance. - */ - public static double distance(Point aP1, Point aP2) { - return distance( aP1.getCoordinateSystem().toReferenceSystem(aP1.getCoordinates()), - aP2.getCoordinateSystem().toReferenceSystem(aP2.getCoordinates())); - } - -}