1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 package triptracker.core;
21
22 /***
23 * The Earth is not an exact ellipsoid. In fact, because the Earth is such a
24 * "lumpy" ellipsoid no single smooth ellipsoid will provide a perfect reference
25 * surface for the entire Earth.
26 * <p>
27 * The practical solution to this is to measure the Earth's shape in different
28 * areas and to then create different reference ellipsoids used for mapping
29 * different regions on Earth.
30 * <p>
31 * Different datums is used for flattening out this lumpy ellipsoid. They create
32 * an reference ellipsoid used for mapping different regions on earth. The
33 * reference ellipsoid is created by the Earth's radius and the Earths
34 * eccentricity values. Evidently, this values is different for the each datums.
35 *
36 * @see
37 * <a href="http://exchange.manifold.net/manifold/manuals/5_userman/mfd50The_Earth_as_an_Ellipsoid.htm">
38 * The Earth as an Ellipsoid:</a>
39 */
40 public class Ellipsoid {
41
42 private final String name;
43 private final double radius;
44
45
46 private final double eccentricity;
47
48 public Ellipsoid(String name, double radius, double eccentricity) {
49 this.name = name;
50 this.radius = radius;
51 this.eccentricity = eccentricity;
52 }
53
54 @Override
55 public String toString() {
56 return (new StringBuilder()).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 datum
63 *
64 * @return eccentricity value based on the datum
65 */
66 public double getEccentricity() {
67 return eccentricity;
68 }
69
70 /***
71 * Returns the datum's name
72 *
73 * @return name of the datum
74 */
75 public String getName() {
76 return name;
77 }
78
79 /***
80 * Returns earths radius value based on the active datum
81 *
82 * @return radius value based on the datum
83 */
84 public double getRadius() {
85 return radius;
86 }
87 }