1 #ifndef __DALI_RADIAN_H__
2 #define __DALI_RADIAN_H__
5 * Copyright (c) 2014 Samsung Electronics Co., Ltd.
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
22 #include <dali/public-api/common/dali-common.h>
30 * @brief An angle in radians.
32 * This reduces ambiguity when using methods which accept angles in degrees or radians.
34 struct DALI_IMPORT_API Radian
37 * @brief Create an angle in radians.
39 * @param[in] value The initial value in radians.
41 explicit Radian( float value );
44 * @brief Create an angle in radians from an angle in degrees.
46 * @param[in] value The initial value in degrees.
48 Radian( const Degree& value );
51 * @brief Compare equality between two radians.
53 * @param[in] rhs Radian to compare to
54 * @return true if the value is identical
56 bool operator==( const Radian& rhs ) const;
59 * @brief Compare inequality between two radians.
61 * @param[in] rhs Radian to compare to
62 * @return true if the value is not identical
64 bool operator!=( const Radian& rhs ) const;
67 * @brief Compare two radians.
69 * @param[in] rhs Radian to compare to
70 * @return true if this is less than the value
72 bool operator<( const Radian& rhs ) const;
75 * @brief Assign an angle from a float value.
77 * @param[in] value Float value in radians
78 * @return a reference to this object
80 Radian& operator=( const float value );
83 * @brief Assign an angle in degrees to a Radian.
85 * @param[in] rhs Degree to get the value from
86 * @return a reference to this object
88 Radian& operator=( const Degree& rhs );
91 * @brief Cast operator to const float reference.
93 operator const float&() const;
96 * @brief Cast operator to float reference.
102 float mValue; ///< The value in radians
104 // disable default constructor
110 #endif // __DALI_RADIAN_H__