merge with master
[framework/osp/locations.git] / src / FLoc_MathUtils.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_MathUtils.h
21  * @brief       This is the header file for the _MathUtils class.
22  *
23  * This header file contains declaration of the _MathUtils class.
24  *
25  */
26
27 #ifndef _FLOC_INTERNAL_MATH_UTILS_H_
28 #define _FLOC_INTERNAL_MATH_UTILS_H_
29
30 namespace Tizen { namespace Base { namespace Collection
31 {
32         class IList;
33 }}}
34
35 namespace Tizen { namespace Locations
36 {
37
38 // forward declaration
39 class Location;
40 class _RegionInfo;
41
42 /**
43  * @class   _MathUtils
44  * @since 2.0
45  *
46  * This class provides fundamental constants and operations for helping mathematical calculation.
47  */
48 class _MathUtils
49 {
50 public:
51         // This method calculates the overlapped area between a region circle and the location uncertainty circle with horizontal accuracy as the radius.
52         // @since 2.0
53         //
54         static double CalculateOverlapRegion(const _RegionInfo& region, const Location& location);
55
56         // This method returns the distance between the user's current location and the the nearest boundary among the added monitoring regions.
57         // @since 2.0
58         //
59         static double GetShortestDistance(const Location& location, const Tizen::Base::Collection::IList& regionList);
60
61
62 public:
63         static const double PI;
64         static const double PI2;
65         static const double DEG2RAD;
66         static const double RAD2DEG;
67         static const double HALFPI;
68         static const double CENTRE_LATITUDE;
69
70 private:
71         _MathUtils(void);
72 };  // class _MathUtils
73
74 } } // Tizen::Locations
75
76 #endif // _FLOC_INTERNAL_MATH_UTILS_H_