1/*2* Trip Tracker, a real-time position tracking system for the Internet.3* Copyright (C) 2006 Team Trip Tracker4*5* This program is free software; you can redistribute it and/or modify it6* under the terms of the GNU General Public License as published by the7* Free Software Foundation; either version 2 of the License, or (at your8* option) any later version.9*10* This program is distributed in the hope that it will be useful, but11* WITHOUT ANY WARRANTY; without even the implied warranty of12* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU13* General Public License for more details.14*15* You should have received a copy of the GNU General Public License along16* with this program; if not, write to the Free Software Foundation, Inc.,17* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA18*/19 20packagetriptracker.core; 21 22/**23** The Earth is not an exact ellipsoid. In fact, because the Earth is such a24* "lumpy" ellipsoid no single smooth ellipsoid will provide a perfect reference25* surface for the entire Earth.26* <p>27* The practical solution to this is to measure the Earth's shape in different28* areas and to then create different reference ellipsoids used for mapping29* different regions on Earth.30* <p>31* Different datums is used for flattening out this lumpy ellipsoid. They create32* an reference ellipsoid used for mapping different regions on earth. The33* reference ellipsoid is created by the Earth's radius and the Earths34* eccentricity values. Evidently, this values is different for the each datums.35*36* @see37* <a href="http://exchange.manifold.net/manifold/manuals/5_userman/mfd50The_Earth_as_an_Ellipsoid.htm">38* The Earth as an Ellipsoid:</a>39*/40publicclassEllipsoid { 41 42privatefinalString name; 43privatefinaldoubleradius; 44 45//The square of this ellipsoid's eccentricity46privatefinaldoubleeccentricity; 47 48publicEllipsoid(String name,doubleradius,doubleeccentricity) { 49this.name = name; 50this.radius = radius; 51this.eccentricity = eccentricity; 52 } 53 54 @Override 55publicString toString() { 56return(newStringBuilder()).append("Ellipsoid[radius=").append( 57 radius).append(",eccentricity=").append(eccentricity).append( 58 "]").toString(); 59 } 60 61/**62** Returns earths eccentricity value based on the active datum63*64* @return eccentricity value based on the datum65*/66publicdoublegetEccentricity() { 67returneccentricity; 68 } 69 70/**71** Returns the datum's name72*73* @return name of the datum74*/75publicString getName() { 76returnname; 77 } 78 79/**80** Returns earths radius value based on the active datum81*82* @return radius value based on the datum83*/84publicdoublegetRadius() { 85returnradius; 86 } 87 }