*
*/
-// EXTERNAL INCLUDES
-#include <ostream>
-
// INTERNAL INCLUDES
#include <dali/public-api/common/constants.h>
#include <dali/public-api/common/dali-common.h>
namespace Dali
{
+/**
+ * @addtogroup dali_core_math
+ * @{
+ */
/**
* @brief An angle in radians.
*
* This reduces ambiguity when using methods which accept angles in degrees or radians.
+ * @SINCE_1_0.0
*/
struct Radian
{
/**
* @brief default constructor, initialises to 0.
+ * @SINCE_1_0.0
*/
Radian()
: radian( 0.f )
/**
* @brief Create an angle in radians.
*
+ * @SINCE_1_0.0
* @param[in] value The initial value in radians.
*/
explicit Radian( float value )
/**
* @brief Create an angle in radians from an angle in degrees.
*
+ * @SINCE_1_0.0
* @param[in] degree The initial value in degrees.
*/
Radian( Degree degree )
/**
* @brief Assign an angle from a float value.
*
+ * @SINCE_1_0.0
* @param[in] value Float value in radians
- * @return a reference to this object
+ * @return A reference to this
*/
Radian& operator=( float value )
{
/**
* @brief Assign an angle from a Degree value.
*
+ * @SINCE_1_0.0
* @param[in] degree The value in degrees.
- * @return a reference to this object
+ * @return A reference to this
*/
Radian& operator=( Degree degree )
{
/**
* @brief Conversion to float
+ * @SINCE_1_0.0
* @return the float value of this Radian
*/
operator float() const
// compiler generated destructor, copy constructor and assignment operators are ok as this class is POD
-// useful constant angles
-static const Radian ANGLE_360 = Radian( Math::PI * 2.00f ); ///< 360 degree turn in radians
-static const Radian ANGLE_315 = Radian( Math::PI * 1.75f ); ///< 315 degree turn in radians
-static const Radian ANGLE_270 = Radian( Math::PI * 1.50f );///< 270 degree turn in radians
-static const Radian ANGLE_225 = Radian( Math::PI * 1.25f ); ///< 225 degree turn in radians
-static const Radian ANGLE_180 = Radian( Math::PI ); ///< 180 degree turn in radians
-static const Radian ANGLE_135 = Radian( Math::PI * 0.75f ); ///< 135 degree turn in radians
-static const Radian ANGLE_120 = Radian( Math::PI / 3.00f ); ///< 120 degree turn in radians
-static const Radian ANGLE_90 = Radian( Math::PI_2 ); ///< 90 degree turn in radians
-static const Radian ANGLE_45 = Radian( Math::PI_4 ); ///< 45 degree turn in radians
-static const Radian ANGLE_30 = Radian( Math::PI / 6.00f ); ///< 30 degree turn in radians
-static const Radian ANGLE_0 = Radian( 0.0f ); ///< 0 degree turn in radians
-
/**
* @brief Compare equality between two radians.
*
+ * @SINCE_1_0.0
* @param[in] lhs Radian to compare
* @param[in] rhs Radian to compare to
* @return true if the values are identical
/**
* @brief Compare inequality between two radians.
*
+ * @SINCE_1_0.0
* @param[in] lhs Radian to compare
* @param[in] rhs Radian to compare to
* @return true if the values are not identical
/**
* @brief Compare equality between a radian and degree.
*
+ * @SINCE_1_0.0
* @param[in] lhs Radian to compare
* @param[in] rhs Degree to compare to
* @return true if the values are identical
/**
* @brief Compare inequality between a radian and a degree.
*
+ * @SINCE_1_0.0
* @param[in] lhs Radian to compare
* @param[in] rhs Degree to compare to
* @return true if the values are not identical
/**
* @brief Compare equality between a degree and a radian.
*
+ * @SINCE_1_0.0
* @param[in] lhs Degree to compare
* @param[in] rhs Radian to compare to
* @return true if the values are identical
/**
* @brief Compare inequality between a degree and a radian.
*
+ * @SINCE_1_0.0
* @param[in] lhs Degree to compare
* @param[in] rhs Radian to compare to
* @return true if the values are not identical
/**
* @brief Compare greater than between two radians
*
+ * @SINCE_1_0.0
* @param[in] lhs Radian to compare
* @param[in] rhs Radian to compare to
* @return true if lhs is greater than rhs
/**
* @brief Compare greater than between a radian and a degree.
*
+ * @SINCE_1_0.0
* @param[in] lhs Radian to compare
* @param[in] rhs Degree to compare to
* @return true if lhs is greater than rhs
/**
* @brief Compare greater than between a radian and a degree.
*
+ * @SINCE_1_0.0
* @param[in] lhs Radian to compare
* @param[in] rhs Degree to compare to
* @return true if lhs is greater than rhs
/**
* @brief Compare less than between two radians.
*
+ * @SINCE_1_0.0
* @param[in] lhs Radian to compare
* @param[in] rhs Radian to compare to
* @return true if lhs is less than rhs
/**
* @brief Compare less than between a radian and a degree.
*
+ * @SINCE_1_0.0
* @param[in] lhs Radian to compare
* @param[in] rhs Degree to compare to
* @return true if lhs is less than rhs
/**
* @brief Compare less than between a degree and a radian.
*
+ * @SINCE_1_0.0
* @param[in] lhs Degree to compare
* @param[in] rhs Radian to compare to
* @return true if lhs is less than rhs
/**
* @brief Multiply Radian with a float
*
+ * @SINCE_1_0.0
* @param[in] lhs Radian to multiply
* @param[in] rhs float to multiply
* @return result of the multiplication
/**
* @brief Negate the radian
+ * @SINCE_1_0.0
+ * @param[in] in Radian to negate
* @return The negative angle
*/
inline Radian operator-( Radian in )
/**
* @brief Clamp a radian value
+ * @SINCE_1_0.0
* @param angle to clamp
* @param min value
* @param max value
}
/**
- * @brief Stream a radian value
- * @param [in] ostream The output stream to use.
- * @param [in] angle in Radian.
- * @return The output stream.
+ * @}
*/
-inline std::ostream& operator<<( std::ostream& ostream, Radian angle )
-{
- ostream << angle.radian;
- return ostream;
-}
-
} // namespace Dali
#endif // __DALI_RADIAN_H__