Dali 3D User Interface Engine
Classes | Namespaces | Typedefs | Functions | Variables
Dali_core_math

Classes

struct  Dali::Power< mantissa, exponent >
 Compile time template to calculate base to the power of N. More...
 
struct  Dali::Power< mantissa, 1 >
 Compile time template to calculate base to the power of N. More...
 
struct  Dali::Power< mantissa, 0 >
 Compile time template to calculate base to the power of N. More...
 
struct  Dali::Log< number, base >
 Compile time template to calculate base logarithm of N. More...
 
struct  Dali::Log< 1, base >
 Compile time template to calculate base logarithm of N. More...
 
struct  Dali::Log< 0, base >
 Compile time template to calculate base logarithm of N. More...
 
struct  Dali::Epsilon< N >
 Compile time template to calculate the machine epsilon for a given floating point number. More...
 
struct  Dali::Epsilon< 1 >
 Compile time template to calculate the machine epsilon for a given floating point number. More...
 
struct  Dali::Epsilon< 0 >
 Compile time template to calculate the machine epsilon for a given floating point number. More...
 
struct  Dali::Degree
 An angle in degrees. More...
 
class  Dali::Matrix
 The Matrix class represents transformations and projections. More...
 
struct  Dali::TypeTraits< Matrix >
 
class  Dali::Matrix3
 A 3x3 matrix. More...
 
struct  Dali::TypeTraits< Matrix3 >
 
class  Dali::Quaternion
 The Quaternion class encapsulates the mathematics of the quaternion. More...
 
struct  Dali::TypeTraits< Quaternion >
 
struct  Dali::Radian
 An angle in radians. More...
 
class  Dali::Uint16Pair
 Simple class for passing around pairs of small unsigned integers. More...
 
struct  Dali::TypeTraits< Uint16Pair >
 
struct  Dali::Vector2
 A two dimensional vector. More...
 
struct  Dali::TypeTraits< Vector2 >
 
struct  Dali::Vector3
 A three dimensional vector. More...
 
struct  Dali::TypeTraits< Vector3 >
 
struct  Dali::Vector4
 A four dimensional vector. More...
 
struct  Dali::TypeTraits< Vector4 >
 

Namespaces

namespace  Dali::Random
 Provides methods to generate and use random values.
 

Typedefs

typedef Vector2 Dali::Size
 Size is an alias of Dali::Vector2 .0. More...
 
typedef Rect< int > Dali::Viewport
 Typedef for a viewport ( a rectangle representing a screen area ). More...
 

Functions

bool Dali::operator== (const Degree &lhs, const Degree &rhs)
 Compare equality between two degrees. More...
 
bool Dali::operator!= (const Degree &lhs, const Degree &rhs)
 Compare inequality between two degrees. More...
 
Degree Dali::Clamp (Degree angle, float min, float max)
 Clamp a radian value .0. More...
 
unsigned int Dali::NextPowerOfTwo (unsigned int i)
 Returns the next power of two. More...
 
bool Dali::IsPowerOfTwo (unsigned int i)
 Whether a number is power of two. More...
 
template<typename T >
const T & Dali::Clamp (const T &value, const T &min, const T &max)
 Clamp a value. More...
 
template<typename T >
void Dali::ClampInPlace (T &value, const T &min, const T &max)
 Clamp a value directly. More...
 
template<typename T >
const T Dali::Lerp (const float offset, const T &low, const T &high)
 Linear interpolation between two values. More...
 
float Dali::GetRangedEpsilon (float a, float b)
 Get an epsilon that is valid for the given range. More...
 
bool Dali::EqualsZero (float value)
 Helper function to compare equality of a floating point value with zero. More...
 
bool Dali::Equals (float a, float b)
 Helper function to compare equality of two floating point values. More...
 
bool Dali::Equals (float a, float b, float epsilon)
 Helper function to compare equality of two floating point values. More...
 
float Dali::Round (float value, int pos)
 Get an float that is rounded at specified place of decimals. More...
 
float Dali::WrapInDomain (float x, float start, float end)
 Wrap x in domain (start) to (end). More...
 
float Dali::ShortestDistanceInDomain (float a, float b, float start, float end)
 Find the shortest distance (magnitude) and direction (sign) from (a) to (b) in domain (start) to (end). More...
 
template<typename T >
int Dali::Sign (T value)
 Extracts the sign of a number. More...
 
std::ostream & Dali::operator<< (std::ostream &o, const Matrix &matrix)
 Print a matrix. More...
 
std::ostream & Dali::operator<< (std::ostream &o, const Matrix3 &matrix)
 Print a 3x3 matrix. More...
 
std::ostream & Dali::operator<< (std::ostream &o, const Quaternion &quaternion)
 Print a Quaternion. More...
 
bool Dali::operator== (Radian lhs, Radian rhs)
 Compare equality between two radians. More...
 
bool Dali::operator!= (Radian lhs, Radian rhs)
 Compare inequality between two radians. More...
 
bool Dali::operator== (Radian lhs, Degree rhs)
 Compare equality between a radian and degree. More...
 
bool Dali::operator!= (Radian lhs, Degree rhs)
 Compare inequality between a radian and a degree. More...
 
bool Dali::operator== (Degree lhs, Radian rhs)
 Compare equality between a degree and a radian. More...
 
bool Dali::operator!= (Degree lhs, Radian rhs)
 Compare inequality between a degree and a radian. More...
 
bool Dali::operator> (Radian lhs, Radian rhs)
 Compare greater than between two radians. More...
 
bool Dali::operator> (Radian lhs, Degree rhs)
 Compare greater than between a radian and a degree. More...
 
bool Dali::operator> (Degree lhs, Radian rhs)
 Compare greater than between a radian and a degree. More...
 
bool Dali::operator< (Radian lhs, Radian rhs)
 Compare less than between two radians. More...
 
bool Dali::operator< (Radian lhs, Degree rhs)
 Compare less than between a radian and a degree. More...
 
bool Dali::operator< (Degree lhs, Radian rhs)
 Compare less than between a degree and a radian. More...
 
Radian Dali::operator* (Radian lhs, float rhs)
 Multiply Radian with a float. More...
 
Radian Dali::operator- (Radian in)
 Negate the radian .0. More...
 
Radian Dali::Clamp (Radian angle, float min, float max)
 Clamp a radian value .0. More...
 
std::ostream & Dali::operator<< (std::ostream &o, const Vector2 &vector)
 Print a Vector2. More...
 
Vector2 Dali::Min (const Vector2 &a, const Vector2 &b)
 Returns a vector with components set to the minimum of the corresponding component in a and b. More...
 
Vector2 Dali::Max (const Vector2 &a, const Vector2 &b)
 Returns a vector with components set to the maximum of the corresponding component in a and b. More...
 
Vector2 Dali::Clamp (const Vector2 &v, const float &min, const float &max)
 Clamps each of vector v's components between minimum and maximum values. More...
 
std::ostream & Dali::operator<< (std::ostream &o, const Vector3 &vector)
 Print a Vector3. More...
 
Vector3 Dali::Min (const Vector3 &a, const Vector3 &b)
 Returns a vector with components set to the minimum of the corresponding component in a and b. More...
 
Vector3 Dali::Max (const Vector3 &a, const Vector3 &b)
 Returns a vector with components set to the maximum of the corresponding component in a and b. More...
 
Vector3 Dali::Clamp (const Vector3 &v, const float &min, const float &max)
 Clamps each of vector v's components between minimum and maximum values. More...
 
std::ostream & Dali::operator<< (std::ostream &o, const Vector4 &vector)
 Print a Vector4. More...
 
Vector4 Dali::Min (const Vector4 &a, const Vector4 &b)
 Returns a vector with components set to the minimum of the corresponding component in a and b. More...
 
Vector4 Dali::Max (const Vector4 &a, const Vector4 &b)
 Returns a vector with components set to the maximum of the corresponding component in a and b. More...
 
Vector4 Dali::Clamp (const Vector4 &v, const float &min, const float &max)
 Clamps each of vector v's components between minimum and maximum values. More...
 

Variables

const Radian Dali::ANGLE_360 = Radian( Math::PI * 2.f )
 360 degree turn in radians More...
 
const Radian Dali::ANGLE_315 = Radian( Math::PI * 1.75f )
 315 degree turn in radians More...
 
const Radian Dali::ANGLE_270 = Radian( Math::PI * 1.5f )
 270 degree turn in radians More...
 
const Radian Dali::ANGLE_225 = Radian( Math::PI * 1.25f )
 225 degree turn in radians More...
 
const Radian Dali::ANGLE_180 = Radian( Math::PI )
 180 degree turn in radians More...
 
const Radian Dali::ANGLE_135 = Radian( Math::PI * 0.75f )
 135 degree turn in radians More...
 
const Radian Dali::ANGLE_120 = Radian( Math::PI * 2.f/3.f )
 120 degree turn in radians More...
 
const Radian Dali::ANGLE_90 = Radian( Math::PI_2 )
 90 degree turn in radians More...
 
const Radian Dali::ANGLE_60 = Radian( Math::PI / 3.f )
 60 degree turn in radians More...
 
const Radian Dali::ANGLE_45 = Radian( Math::PI_4 )
 45 degree turn in radians More...
 
const Radian Dali::ANGLE_30 = Radian( Math::PI / 6.f )
 30 degree turn in radians More...
 
const Radian Dali::ANGLE_0 = Radian( 0.0f )
 0 degree turn in radians More...
 

Detailed Description

Typedef Documentation

typedef Vector2 Dali::Size

Size is an alias of Dali::Vector2 .0.

Definition at line 461 of file vector2.h.

typedef Rect<int> Dali::Viewport

Typedef for a viewport ( a rectangle representing a screen area ).

.0

Definition at line 35 of file viewport.h.

Function Documentation

template<typename T >
const T& Dali::Clamp ( const T &  value,
const T &  min,
const T &  max 
)
inline

Clamp a value.

.0

Parameters
[in]valueThe value to clamp.
[in]minThe minimum allowed value.
[in]maxThe maximum allowed value.
Returns
T the clamped value

Definition at line 81 of file math-utils.h.

References Dali::Toolkit::Text::min().

Here is the call graph for this function:

DALI_IMPORT_API Vector2 Dali::Clamp ( const Vector2 &  v,
const float &  min,
const float &  max 
)

Clamps each of vector v's components between minimum and maximum values.

.0

Parameters
[in]va vector
[in]minthe minimum value
[in]maxthe maximum value
Returns
a vector containing the clamped components of v

Definition at line 118 of file vector2.cpp.

References Dali::Vector2::Clamp().

Here is the call graph for this function:

Degree Dali::Clamp ( Degree  angle,
float  min,
float  max 
)
inline
DALI_IMPORT_API Vector3 Dali::Clamp ( const Vector3 &  v,
const float &  min,
const float &  max 
)

Clamps each of vector v's components between minimum and maximum values.

.0

Parameters
[in]va vector
[in]minthe minimum value
[in]maxthe maximum value
Returns
a vector containing the clamped components of v

Definition at line 174 of file vector3.cpp.

References Dali::Vector3::Clamp().

Here is the call graph for this function:

DALI_IMPORT_API Vector4 Dali::Clamp ( const Vector4 &  v,
const float &  min,
const float &  max 
)

Clamps each of vector v's components between minimum and maximum values.

.0

Parameters
[in]va vector
[in]minthe minimum value
[in]maxthe maximum value
Returns
a vector containing the clamped components of v

Definition at line 174 of file vector4.cpp.

References Dali::Vector4::Clamp().

Here is the call graph for this function:

Radian Dali::Clamp ( Radian  angle,
float  min,
float  max 
)
inline

Clamp a radian value .0.

Parameters
angleto clamp
minvalue
maxvalue
Returns
the resulting radian

Definition at line 302 of file radian.h.

References Dali::Radian::radian.

template<typename T >
void Dali::ClampInPlace ( T &  value,
const T &  min,
const T &  max 
)
inline

Clamp a value directly.

.0

Parameters
[in,out]valueThe value that will be clamped.
[in]minThe minimum allowed value.
[in]maxThe maximum allowed value.

Definition at line 97 of file math-utils.h.

References Dali::Toolkit::Text::min().

Referenced by UtcDaliMathUtilsClampInPlaceP(), and UtcDaliMathUtilsClampP().

Here is the call graph for this function:

Here is the caller graph for this function:

bool Dali::Equals ( float  a,
float  b 
)
inline

Helper function to compare equality of two floating point values.

.0

Parameters
[in]athe first value to compare
[in]bthe second value to compare
Returns
true if the values are equal within a minimal epsilon for their values

Definition at line 183 of file math-utils.h.

References Dali::GetRangedEpsilon().

Referenced by Dali::Toolkit::Text::AtlasRenderer::Impl::AdjustExtents(), Dali::Internal::SceneGraph::CompareItems3D(), Dali::Internal::SceneGraph::anonymous_namespace{scene-graph-camera-attachment.cpp}::Frustum(), Dali::Matrix::InvertTransform(), Dali::Matrix3::operator==(), operator==(), Dali::Internal::SceneGraph::anonymous_namespace{scene-graph-camera-attachment.cpp}::Orthographic(), Dali::Internal::CameraAttachment::SetAspectRatio(), Dali::Internal::CameraAttachment::SetBottomClippingPlane(), Dali::Internal::CameraAttachment::SetFarClippingPlane(), Dali::Internal::CameraAttachment::SetFieldOfView(), Dali::Internal::CameraAttachment::SetLeftClippingPlane(), Dali::Internal::CameraAttachment::SetNearClippingPlane(), Dali::Internal::CameraAttachment::SetProjectionMode(), Dali::Toolkit::Internal::TextLabel::SetProperty(), Dali::Toolkit::Internal::TextField::SetProperty(), Dali::Toolkit::Internal::TextEditor::SetProperty(), Dali::Toolkit::Internal::ItemView::SetRefreshInterval(), Dali::Internal::CameraAttachment::SetRightClippingPlane(), Dali::Internal::Stage::SetStereoBase(), Dali::Internal::CameraAttachment::SetStereoBias(), Dali::Internal::CameraAttachment::SetTopClippingPlane(), UtcDaliAnimationSetSpeedFactorAndRange(), UtcDaliMathUtilsEquals01P(), UtcDaliMathUtilsEquals02P(), and UtcDaliPropertyValueAssignmentOperatorFloatP().

Here is the call graph for this function:

Here is the caller graph for this function:

bool Dali::Equals ( float  a,
float  b,
float  epsilon 
)
inline

Helper function to compare equality of two floating point values.

.0

Parameters
[in]athe first value to compare
[in]bthe second value to compare
[in]epsilonthe minimum epsilon value that will be used to consider the values different
Returns
true if the difference between the values is less than the epsilon

Definition at line 197 of file math-utils.h.

bool Dali::EqualsZero ( float  value)
inline
float Dali::GetRangedEpsilon ( float  a,
float  b 
)
inline
bool Dali::IsPowerOfTwo ( unsigned int  i)
inline

Whether a number is power of two.

.0

Parameters
[in]iinput number
Returns
true if i is power of two

Definition at line 66 of file math-utils.h.

Referenced by UtcDaliMathUtilsIsPowerOfTwo().

Here is the caller graph for this function:

template<typename T >
const T Dali::Lerp ( const float  offset,
const T &  low,
const T &  high 
)
inline

Linear interpolation between two values.

.0

Parameters
[in]offsetThe offset through the range low to high. This value is clamped between 0 and 1
[in]lowLowest value in range
[in]highHighest value in range
Returns
A value between low and high.

Definition at line 116 of file math-utils.h.

References Dali::Clamp().

Referenced by UtcDaliMathUtilsLerpP().

Here is the call graph for this function:

Here is the caller graph for this function:

Vector2 Dali::Max ( const Vector2 &  a,
const Vector2 &  b 
)
inline

Returns a vector with components set to the maximum of the corresponding component in a and b.

If a=0,1 and b=1,0 returns a vector of 1,1 .0

Parameters
[in]aa vector
[in]ba vector
Returns
a vector containing the maximum of each component from a and b

Definition at line 496 of file vector2.h.

References Dali::Vector2::x, and Dali::Vector2::y.

Referenced by UtcDaliVector2MaxP(), UtcDaliVector3MaxP(), and UtcDaliVector4MaxP().

Here is the caller graph for this function:

Vector3 Dali::Max ( const Vector3 &  a,
const Vector3 &  b 
)
inline

Returns a vector with components set to the maximum of the corresponding component in a and b.

If a=0,1 and b=1,0 returns a vector of 1,1 .0

Parameters
[in]aa vector
[in]ba vector
Returns
a vector containing the maximum of each component from a and b

Definition at line 588 of file vector3.h.

References Dali::Vector3::x, Dali::Vector3::y, and Dali::Vector3::z.

Vector4 Dali::Max ( const Vector4 &  a,
const Vector4 &  b 
)
inline

Returns a vector with components set to the maximum of the corresponding component in a and b.

If a=0,1,2,3 and b=4,0,1,2 returns a vector of 4,1,2,3 .0

Parameters
[in]aa vector
[in]ba vector
Returns
a vector containing the maximum of each component from a and b

Definition at line 590 of file vector4.h.

References Dali::Vector4::w, Dali::Vector4::x, Dali::Vector4::y, and Dali::Vector4::z.

Vector2 Dali::Min ( const Vector2 &  a,
const Vector2 &  b 
)
inline

Returns a vector with components set to the minimum of the corresponding component in a and b.

If a=0,1 and b=1,0 returns a vector of 0,0. .0

Parameters
[in]aa vector
[in]ba vector
Returns
a vector containing the minimum of each component from a and b

Definition at line 482 of file vector2.h.

References Dali::Vector2::x, and Dali::Vector2::y.

Referenced by UtcDaliVector2MinP(), UtcDaliVector3MinP(), and UtcDaliVector4MinP().

Here is the caller graph for this function:

Vector3 Dali::Min ( const Vector3 &  a,
const Vector3 &  b 
)
inline

Returns a vector with components set to the minimum of the corresponding component in a and b.

If a=0,1,2 and b=2,1,0 returns a vector of 2,1,2. .0

Parameters
[in]aa vector
[in]ba vector
Returns
a vector containing the minimum of each component from a and b

Definition at line 572 of file vector3.h.

References Dali::Vector3::x, Dali::Vector3::y, and Dali::Vector3::z.

Vector4 Dali::Min ( const Vector4 &  a,
const Vector4 &  b 
)
inline

Returns a vector with components set to the minimum of the corresponding component in a and b.

If a=0,1,2,3 and b=4,0,1,2 returns a vector of 0,0,1,2 .0

Parameters
[in]aa vector
[in]ba vector
Returns
a vector containing the minimum of each component from a and b

Definition at line 573 of file vector4.h.

References Dali::Vector4::w, Dali::Vector4::x, Dali::Vector4::y, and Dali::Vector4::z.

unsigned int Dali::NextPowerOfTwo ( unsigned int  i)
inline

Returns the next power of two.

In case of numbers which are already a power of two this function returns the original number. If i is zero returns 1 .0

Parameters
[in]iinput number
Returns
next power of two or i itself in case it's a power of two

Definition at line 41 of file math-utils.h.

References DALI_ASSERT_ALWAYS.

Referenced by Dali::TizenPlatform::GetTextureDimension(), Dali::VectorAlgorithms< TypeTraits< Dali::Toolkit::AtlasManager::AtlasMetricsEntry >::IS_TRIVIAL_TYPE==true >::Insert(), UtcDaliMathUtilsNextPowerOfTwoN(), and UtcDaliMathUtilsNextPowerOfTwoP().

Here is the caller graph for this function:

bool Dali::operator!= ( const Degree &  lhs,
const Degree &  rhs 
)
inline

Compare inequality between two degrees.

.0

Parameters
[in]lhsDegree to compare
[in]rhsDegree to compare to
Returns
true if the values are not identical

Definition at line 113 of file degree.h.

References Dali::operator==().

Here is the call graph for this function:

bool Dali::operator!= ( Radian  lhs,
Radian  rhs 
)
inline

Compare inequality between two radians.

.0

Parameters
[in]lhsRadian to compare
[in]rhsRadian to compare to
Returns
true if the values are not identical

Definition at line 136 of file radian.h.

References Dali::operator==().

Here is the call graph for this function:

bool Dali::operator!= ( Radian  lhs,
Degree  rhs 
)
inline

Compare inequality between a radian and a degree.

.0

Parameters
[in]lhsRadian to compare
[in]rhsDegree to compare to
Returns
true if the values are not identical

Definition at line 162 of file radian.h.

References Dali::operator==().

Here is the call graph for this function:

bool Dali::operator!= ( Degree  lhs,
Radian  rhs 
)
inline

Compare inequality between a degree and a radian.

.0

Parameters
[in]lhsDegree to compare
[in]rhsRadian to compare to
Returns
true if the values are not identical

Definition at line 188 of file radian.h.

References Dali::operator==().

Here is the call graph for this function:

Radian Dali::operator* ( Radian  lhs,
float  rhs 
)
inline

Multiply Radian with a float.

.0

Parameters
[in]lhsRadian to multiply
[in]rhsfloat to multiply
Returns
result of the multiplication

Definition at line 279 of file radian.h.

References Dali::Radian::radian.

Radian Dali::operator- ( Radian  in)
inline

Negate the radian .0.

Returns
The negative angle

Definition at line 289 of file radian.h.

References Dali::Radian::radian.

bool Dali::operator< ( Radian  lhs,
Radian  rhs 
)
inline

Compare less than between two radians.

.0

Parameters
[in]lhsRadian to compare
[in]rhsRadian to compare to
Returns
true if lhs is less than rhs

Definition at line 240 of file radian.h.

References Dali::Radian::radian.

bool Dali::operator< ( Radian  lhs,
Degree  rhs 
)
inline

Compare less than between a radian and a degree.

.0

Parameters
[in]lhsRadian to compare
[in]rhsDegree to compare to
Returns
true if lhs is less than rhs

Definition at line 253 of file radian.h.

References Dali::Radian::radian.

bool Dali::operator< ( Degree  lhs,
Radian  rhs 
)
inline

Compare less than between a degree and a radian.

.0

Parameters
[in]lhsDegree to compare
[in]rhsRadian to compare to
Returns
true if lhs is less than rhs

Definition at line 266 of file radian.h.

References Dali::Radian::radian.

DALI_IMPORT_API std::ostream & Dali::operator<< ( std::ostream &  o,
const Vector2 &  vector 
)

Print a Vector2.

.0

Parameters
[in]oThe output stream operator.
[in]vectorThe vector to print.
Returns
The output stream operator.

Definition at line 113 of file vector2.cpp.

References Dali::Vector2::x, and Dali::Vector2::y.

DALI_IMPORT_API std::ostream & Dali::operator<< ( std::ostream &  o,
const Vector4 &  vector 
)

Print a Vector4.

.0

Parameters
[in]oThe output stream operator.
[in]vectorThe vector to print.
Returns
The output stream operator.

Definition at line 169 of file vector4.cpp.

References Dali::Vector4::w, Dali::Vector4::x, Dali::Vector4::y, and Dali::Vector4::z.

DALI_IMPORT_API std::ostream & Dali::operator<< ( std::ostream &  o,
const Vector3 &  vector 
)

Print a Vector3.

.0

Parameters
[in]oThe output stream operator.
[in]vectorThe vector to print.
Returns
The output stream operator.

Definition at line 169 of file vector3.cpp.

References Dali::Vector3::x, Dali::Vector3::y, and Dali::Vector3::z.

DALI_IMPORT_API std::ostream & Dali::operator<< ( std::ostream &  o,
const Matrix3 &  matrix 
)

Print a 3x3 matrix.

.0

Parameters
[in]oThe output stream operator.
[in]matrixThe matrix to print.
Returns
The output stream operator.

Definition at line 282 of file matrix3.cpp.

References Dali::Matrix3::mElements.

DALI_IMPORT_API std::ostream & Dali::operator<< ( std::ostream &  o,
const Quaternion &  quaternion 
)

Print a Quaternion.

.0

Parameters
[in]oThe output stream operator.
[in]quaternionThe quaternion to print.
Returns
The output stream operator.

Definition at line 540 of file quaternion.cpp.

References Dali::Degree::degree, Dali::Quaternion::ToAxisAngle(), Dali::Vector3::x, Dali::Vector3::y, and Dali::Vector3::z.

Here is the call graph for this function:

DALI_IMPORT_API std::ostream & Dali::operator<< ( std::ostream &  o,
const Matrix &  matrix 
)

Print a matrix.

It is printed in memory order, i.e. each printed row is contiguous in memory. .0

Parameters
[in]oThe output stream operator.
[in]matrixThe matrix to print.
Returns
The output stream operator.

Definition at line 779 of file matrix.cpp.

References Dali::Matrix::mMatrix.

bool Dali::operator== ( const Degree &  lhs,
const Degree &  rhs 
)
inline

Compare equality between two degrees.

.0

Parameters
[in]lhsDegree to compare
[in]rhsDegree to compare to
Returns
true if the values are identical

Definition at line 100 of file degree.h.

References Dali::Degree::degree, and Dali::Math::MACHINE_EPSILON_1000.

bool Dali::operator== ( Radian  lhs,
Radian  rhs 
)
inline

Compare equality between two radians.

.0

Parameters
[in]lhsRadian to compare
[in]rhsRadian to compare to
Returns
true if the values are identical

Definition at line 123 of file radian.h.

References Dali::Math::MACHINE_EPSILON_10, and Dali::Radian::radian.

bool Dali::operator== ( Radian  lhs,
Degree  rhs 
)
inline

Compare equality between a radian and degree.

.0

Parameters
[in]lhsRadian to compare
[in]rhsDegree to compare to
Returns
true if the values are identical

Definition at line 149 of file radian.h.

References Dali::Math::MACHINE_EPSILON_100, and Dali::Radian::radian.

bool Dali::operator== ( Degree  lhs,
Radian  rhs 
)
inline

Compare equality between a degree and a radian.

.0

Parameters
[in]lhsDegree to compare
[in]rhsRadian to compare to
Returns
true if the values are identical

Definition at line 175 of file radian.h.

References Dali::Math::MACHINE_EPSILON_100, and Dali::Radian::radian.

bool Dali::operator> ( Radian  lhs,
Radian  rhs 
)
inline

Compare greater than between two radians.

.0

Parameters
[in]lhsRadian to compare
[in]rhsRadian to compare to
Returns
true if lhs is greater than rhs

Definition at line 201 of file radian.h.

References Dali::Radian::radian.

bool Dali::operator> ( Radian  lhs,
Degree  rhs 
)
inline

Compare greater than between a radian and a degree.

.0

Parameters
[in]lhsRadian to compare
[in]rhsDegree to compare to
Returns
true if lhs is greater than rhs

Definition at line 214 of file radian.h.

References Dali::Radian::radian.

bool Dali::operator> ( Degree  lhs,
Radian  rhs 
)
inline

Compare greater than between a radian and a degree.

.0

Parameters
[in]lhsRadian to compare
[in]rhsDegree to compare to
Returns
true if lhs is greater than rhs

Definition at line 227 of file radian.h.

References Dali::Radian::radian.

float Dali::Round ( float  value,
int  pos 
)
inline

Get an float that is rounded at specified place of decimals.

.0

Parameters
[in]valuefloat value
[in]posdecimal place
Returns
a rounded float

Definition at line 210 of file math-utils.h.

Referenced by UtcDaliMathUtilsRoundP().

Here is the caller graph for this function:

float Dali::ShortestDistanceInDomain ( float  a,
float  b,
float  start,
float  end 
)
inline

Find the shortest distance (magnitude) and direction (sign) from (a) to (b) in domain (start) to (end).

(\ / start) (\ / end) |-a b<-—|

Knowing the shortest distance is useful with wrapped domains to solve problems such as determing the closest object to a given point, or determing whether turning left or turning right is the shortest route to get from angle 10 degrees to angle 350 degrees (clearly in a 0-360 degree domain, turning left 20 degrees is quicker than turning right 340 degrees).

The value returned holds the distance and the direction from value a to value b. For instance in the above example it would return -20. i.e. subtract 20 from current value (10) to reach target wrapped value (350).

.0

Parameters
athe current value
bthe target value
startthe start of the domain
endthe end of the domain
Returns
the shortest direction (the sign) and distance (the magnitude)
Note
assumes both (a) and (b) are already within the domain (start) to (end)

Definition at line 295 of file math-utils.h.

References a.

Referenced by UtcDaliMathUtilsShortestDistanceInDomainP(), and anonymous_namespace{scroll-view-impl.cpp}::VectorInDomain().

Here is the caller graph for this function:

template<typename T >
int Dali::Sign ( value)

Extracts the sign of a number.

.0

Parameters
[in]valueThe value we want to extract the sign
Returns
-1 for negative values, +1 for positive values and 0 if value is 0

Definition at line 333 of file math-utils.h.

Referenced by Dali::Internal::SceneGraph::CameraAttachment::UpdateFrustum().

Here is the caller graph for this function:

float Dali::WrapInDomain ( float  x,
float  start,
float  end 
)
inline

Wrap x in domain (start) to (end).

This works like a floating point version of the % modulo operation. But with an offset (start).

For instance a domain is specified as: start: 2 end: 8

2 8 (\ / start) (\ / end) |-—x |

The value x will be confined to this domain. If x is below 2 e.g. 0, then it is wraped to 6. If x is above or equal to 8 e.g. 8.1 then it is wrapped to 2.1

Domain wrapping is useful for various problems from calculating positions in a space that repeats, to computing angles that range from 0 to 360.

.0

Parameters
[in]xthe point to be wrapped within the domain
[in]startThe start of the domain
[in]endThe end of the domain
Returns
the wrapped value over the domain (start) (end)
Note
if start = end (i.e. size of domain 0), then wrapping will not occur and result will always be equal to start.

Definition at line 252 of file math-utils.h.

References Dali::Math::MACHINE_EPSILON_1.

Referenced by Dali::Internal::PanGestureDetector::AddAngle(), Dali::Internal::PanGestureDetector::CheckAngleAllowed(), Dali::Toolkit::FixedRuler::GetPageFromPosition(), anonymous_namespace{scroll-view-impl.cpp}::InternalRelativePositionConstraint(), Dali::Toolkit::Internal::ScrollView::OnScrollAnimationFinished(), Dali::Internal::LinearConstraintFunctor::operator()(), Dali::Internal::PathConstraintFunctor::operator()(), Dali::Toolkit::Internal::anonymous_namespace{scroll-view-impl.cpp}::InternalPositionConstraint::operator()(), Dali::Internal::PanGestureDetector::RemoveAngle(), UtcDaliMathUtilsWrapInDomainP(), Dali::Toolkit::WrapActorConstraint(), and Dali::Toolkit::Internal::ScrollView::WrapPosition().

Here is the caller graph for this function:

Variable Documentation

DALI_EXPORT_API const Radian Dali::ANGLE_0 = Radian( 0.0f )
DALI_EXPORT_API const Radian Dali::ANGLE_120 = Radian( Math::PI * 2.f/3.f )

120 degree turn in radians

Definition at line 38 of file degree.cpp.

Referenced by UtcDaliPropertyValueOutputStream().

DALI_EXPORT_API const Radian Dali::ANGLE_135 = Radian( Math::PI * 0.75f )

135 degree turn in radians

Definition at line 37 of file degree.cpp.

DALI_EXPORT_API const Radian Dali::ANGLE_180 = Radian( Math::PI )
DALI_EXPORT_API const Radian Dali::ANGLE_225 = Radian( Math::PI * 1.25f )

225 degree turn in radians

Definition at line 35 of file degree.cpp.

DALI_EXPORT_API const Radian Dali::ANGLE_270 = Radian( Math::PI * 1.5f )

270 degree turn in radians

Definition at line 34 of file degree.cpp.

DALI_EXPORT_API const Radian Dali::ANGLE_30 = Radian( Math::PI / 6.f )

30 degree turn in radians

Definition at line 42 of file degree.cpp.

Referenced by UtcDaliQuaternionSlerpP02().

DALI_EXPORT_API const Radian Dali::ANGLE_315 = Radian( Math::PI * 1.75f )

315 degree turn in radians

Definition at line 33 of file degree.cpp.

DALI_EXPORT_API const Radian Dali::ANGLE_360 = Radian( Math::PI * 2.f )

360 degree turn in radians

Definition at line 32 of file degree.cpp.

Referenced by anonymous_namespace{spiral-layout.cpp}::SpiralColorConstraint::operator()().

DALI_EXPORT_API const Radian Dali::ANGLE_45 = Radian( Math::PI_4 )

45 degree turn in radians

Definition at line 41 of file degree.cpp.

Referenced by UtcDaliAngleBetweenP(), UtcDaliQuaternionSetEulerP(), and UtcDaliQuaternionSlerpNoInvertP01().

DALI_EXPORT_API const Radian Dali::ANGLE_60 = Radian( Math::PI / 3.f )

60 degree turn in radians

Definition at line 40 of file degree.cpp.

Referenced by UtcDaliQuaternionSlerpP02().

DALI_EXPORT_API const Radian Dali::ANGLE_90 = Radian( Math::PI_2 )
Dali Docs Home
Read more about Dali