Tizen 2.0 Release
[framework/osp/locations.git] / src / FLoc_EllipsoidModel.h
1 //
2 // Open Service Platform
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
4 //
5 // Licensed under the Apache License, Version 2.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
8 //
9 //     http://www.apache.org/licenses/LICENSE-2.0
10 //
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
16 //
17
18 /**
19  *
20  * @file        FLoc_EllipsoidModel.h
21  * @brief       This is the header file for the _EllipsoidModel class.
22  *
23  * This header file contains declaration of the _EllipsoidModel class.
24  */
25
26 #ifndef _FLOC_INTERNAL_ELLIPSOID_MODEL_H_
27 #define _FLOC_INTERNAL_ELLIPSOID_MODEL_H_
28
29 namespace Tizen { namespace Locations
30 {
31
32 /**
33  * @class   _EllipsoidModel
34  * @since 2.0
35
36  * This class provides fundamental geodetic constants and operations according to the WGS84 datum.
37  *
38  * References:
39  * @li R.E. Deakin and M.N. Hunter, (2009) 'Geodesics on an ellipsoid - Bessel's method'
40  * @li T.Vincenty, 'Direct and inverse solutions of geodesics on the ellipsoid with application of nested equations'
41  */
42 class _EllipsoidModel
43 {
44 public:
45         static const double SEMI_MAJOR_AXIS;
46         static const double SEMI_MINOR_AXIS;
47         static const double FLATTENING;
48         static const double EARTH_RADIUS;
49
50 public:
51         /**
52          * Calculates the geodesic distance between the cooridnates P1(lat1, lon1) and P2(lat2, lon2).
53          *
54          * @since 2.0
55          */
56         static float GetDistance(double lat1, double lon1, double lat2, double lon2);
57
58         /**
59          * Calculates the forward azimuth of the cooridnates P1(lat1, lon1) and P2(lat2, lon2).
60          *
61          * @since 2.0
62          */
63         static float GetAzimuth(double lat1, double lon1, double lat2, double lon2);
64
65 private:
66         enum ResultType
67         {
68                 RT_DISTANCE,
69                 RT_FORWARD_AZIMUTH
70         };
71
72         _EllipsoidModel(void);
73         static float SolveInverseProblem(double lat1, double lon1, double lat2, double lon2, ResultType type);
74 };  // class _EllipsoidModel
75
76 } } // Tizen::Locations
77
78 #endif // _FLOC_INTERNAL_ELLIPSOID_MODEL_H_