source: subversion/applications/lib/ccoord/RefEll.h @ 34499

Last change on this file since 34499 was 2097, checked in by nick, 13 years ago

updated libosm

File size: 1.6 KB
Line 
1#ifndef REFELL_H
2#define REFELL_H
3
4// Based on Jonathan Stott's JCoord.
5// Licenced under the GNU GPL.
6
7/**
8 * Class to represent a reference ellipsoid. Also provides a number of
9 * pre-determined reference ellipsoids as constants.
10 *
11 * (c) 2006 Jonathan Stott
12 *
13 * Created on 11-Feb-2006
14 *
15 * @author Jonathan Stott
16 * @version 1.0
17 * @since 1.0
18 */
19
20// Converted from JCoord (Java version)
21
22 class RefEll {
23
24  /**
25   * Airy 1830 Reference Ellipsoid
26   */
27               
28   //static final RefEll AIRY_1830 = new RefEll(6377563.396, 6356256.909);
29
30  /**
31   * WGS84 Reference Ellipsoid
32   */
33  //static final RefEll WGS84     = new RefEll(6378137.000, 6356752.3141);
34
35  /**
36   * Semi-major axis
37   */
38private:
39  double             maj;
40
41  /**
42   * Semi-minor axis
43   */
44  double             min;
45
46  /**
47   * Eccentricity
48   */
49  double             ecc;
50
51public:
52
53  /**
54   * Create a new reference ellipsoid
55   *
56   * @param maj
57   *          semi-major axis
58   * @param min
59   *          semi-minor axis
60   * @since 1.0
61   */
62   RefEll(double maj, double min) {
63    this->maj = maj;
64    this->min = min;
65    this->ecc = ((maj * maj) - (min * min)) / (maj * maj);
66  }
67
68
69  /**
70   * Return the semi-major axis.
71   *
72   * @return the semi-major axis
73   * @since 1.0
74   */
75   double getMaj() {
76    return maj;
77  }
78
79
80  /**
81   * Return the semi-minor axis
82   *
83   * @return the semi-minor axis
84   * @since 1.0
85   */
86   double getMin() {
87    return min;
88  }
89
90
91  /**
92   * Return the eccentricity.
93   *
94   * @return the eccentricity
95   * @since 1.0
96   */
97   double getEcc() {
98    return ecc;
99  }
100};
101
102#endif
Note: See TracBrowser for help on using the repository browser.