libcrn  3.9.5
A document image processing library
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
crn::Angle< Unit > Struct Template Reference

A convenience class for angles units. More...

#include <CRNTrigonometry.h>

Public Types

using unit = Unit
 

Public Member Functions

constexpr Angle () noexcept(std::is_nothrow_constructible< typename Unit::type >::value)
 Null angle. More...
 
 Angle (typename Unit::type val) noexcept(std::is_nothrow_constructible< typename Unit::type >::value)
 Constructor from a value. More...
 
template<typename U >
 Angle (const Angle< U > &other) noexcept(std::is_nothrow_constructible< typename U::type >::value &&std::is_nothrow_constructible< typename TypeInfo< typename Unit::type >::SumType >::value)
 Constructor from any other angle unit. More...
 
 Angle (const Angle &)=default
 
 Angle (Angle &&)=default
 
Angleoperator= (const Angle &)=default
 
Angleoperator= (Angle &&)=default
 
template<typename U >
U::type Get () const noexcept(std::is_nothrow_constructible< typename U::type >::value &&std::is_nothrow_constructible< typename TypeInfo< typename Unit::type >::SumType >::value)
 Conversion to any other angle unit. More...
 
Angle operator- () const noexcept(std::is_nothrow_copy_assignable< typename Unit::type >::value)
 Negative of the angle. More...
 
const Angleoperator+= (typename Unit::type angle) noexcept(std::is_nothrow_copy_assignable< typename Unit::type >::value)
 Adds an angle. More...
 
const Angleoperator+= (const Angle &other) noexcept(std::is_nothrow_copy_assignable< typename Unit::type >::value)
 Adds an angle. More...
 
Angle operator+ (const Angle &other) const noexcept(std::is_nothrow_copy_assignable< typename Unit::type >::value)
 Adds an angle. More...
 
const Angleoperator-= (typename Unit::type angle) noexcept(std::is_nothrow_copy_assignable< typename Unit::type >::value)
 Subtracts an angle. More...
 
const Angleoperator-= (const Angle &other) noexcept(std::is_nothrow_copy_assignable< typename Unit::type >::value)
 Subtracts an angle. More...
 
Angle operator- (const Angle &other) const noexcept(std::is_nothrow_copy_assignable< typename Unit::type >::value)
 Subtracts an angle. More...
 
Angleoperator*= (double f) noexcept(std::is_nothrow_copy_assignable< typename Unit::type >::value)
 Multiplies by a scalar. More...
 
Angleoperator* (double f) noexcept(std::is_nothrow_copy_assignable< typename Unit::type >::value)
 Multiplies by a scalar. More...
 
bool operator== (const Angle &other) const noexcept
 Comparison operator. More...
 
double Cos () const noexcept
 Computes cosine. More...
 
double Sin () const noexcept
 Computes sine. More...
 
double Tan () const noexcept
 Computes tangent. More...
 

Static Public Member Functions

static Angle Acos (double cosine) noexcept(std::is_nothrow_constructible< typename Unit::type >::value)
 Computes arc cosine. More...
 
static Angle Asin (double sine) noexcept(std::is_nothrow_constructible< typename Unit::type >::value)
 Computes arc sine. More...
 
static Angle Atan (double tangent) noexcept(std::is_nothrow_constructible< typename Unit::type >::value)
 Computes arc tangent. More...
 
static Angle Atan (double y, double x) noexcept(std::is_nothrow_constructible< typename Unit::type >::value)
 Computes arc tangent from coordinates. More...
 
static constexpr Angle< UnitLEFT ()
 
static constexpr Angle< UnitRIGHT ()
 
static constexpr Angle< UnitTOP ()
 
static constexpr Angle< UnitBOTTOM ()
 

Public Attributes

Unit::type value
 

Detailed Description

template<typename Unit>
struct crn::Angle< Unit >

A convenience class for angles units.

A convenience class for angles units

Definition at line 139 of file CRNTrigonometry.h.

Member Typedef Documentation

template<typename Unit>
using crn::Angle< Unit >::unit = Unit

Definition at line 141 of file CRNTrigonometry.h.

Constructor & Destructor Documentation

template<typename Unit>
constexpr crn::Angle< Unit >::Angle ( )
inlinenoexcept

Null angle.

Definition at line 143 of file CRNTrigonometry.h.

template<typename Unit>
crn::Angle< Unit >::Angle ( typename Unit::type  val)
inlinenoexcept

Constructor from a value.

Definition at line 146 of file CRNTrigonometry.h.

template<typename Unit>
template<typename U >
crn::Angle< Unit >::Angle ( const Angle< U > &  other)
inlinenoexcept

Constructor from any other angle unit.

Definition at line 157 of file CRNTrigonometry.h.

template<typename Unit>
crn::Angle< Unit >::Angle ( const Angle< Unit > &  )
default
template<typename Unit>
crn::Angle< Unit >::Angle ( Angle< Unit > &&  )
default

Member Function Documentation

template<typename Unit>
static Angle crn::Angle< Unit >::Acos ( double  cosine)
inlinestaticnoexcept

Computes arc cosine.

Definition at line 243 of file CRNTrigonometry.h.

template<typename Unit>
static Angle crn::Angle< Unit >::Asin ( double  sine)
inlinestaticnoexcept

Computes arc sine.

Definition at line 245 of file CRNTrigonometry.h.

template<typename Unit>
static Angle crn::Angle< Unit >::Atan ( double  tangent)
inlinestaticnoexcept

Computes arc tangent.

Definition at line 247 of file CRNTrigonometry.h.

template<typename Unit>
static Angle crn::Angle< Unit >::Atan ( double  y,
double  x 
)
inlinestaticnoexcept

Computes arc tangent from coordinates.

Definition at line 249 of file CRNTrigonometry.h.

template<typename Unit>
static constexpr Angle<Unit> crn::Angle< Unit >::BOTTOM ( )
inlinestatic

Angle facing bottom (automatically computed)

Definition at line 254 of file CRNTrigonometry.h.

template<typename Unit>
double crn::Angle< Unit >::Cos ( ) const
inlinenoexcept

Computes cosine.

Definition at line 236 of file CRNTrigonometry.h.

template<typename Unit>
template<typename U >
U::type crn::Angle< Unit >::Get ( ) const
inlinenoexcept

Conversion to any other angle unit.

Definition at line 175 of file CRNTrigonometry.h.

template<typename Unit>
static constexpr Angle<Unit> crn::Angle< Unit >::LEFT ( )
inlinestatic

Angle facing left (automatically computed)

Definition at line 251 of file CRNTrigonometry.h.

template<typename Unit>
Angle& crn::Angle< Unit >::operator* ( double  f)
inlinenoexcept

Multiplies by a scalar.

Definition at line 230 of file CRNTrigonometry.h.

template<typename Unit>
Angle& crn::Angle< Unit >::operator*= ( double  f)
inlinenoexcept

Multiplies by a scalar.

Definition at line 219 of file CRNTrigonometry.h.

template<typename Unit>
Angle crn::Angle< Unit >::operator+ ( const Angle< Unit > &  other) const
inlinenoexcept

Adds an angle.

Definition at line 199 of file CRNTrigonometry.h.

template<typename Unit>
const Angle& crn::Angle< Unit >::operator+= ( typename Unit::type  angle)
inlinenoexcept

Adds an angle.

Definition at line 187 of file CRNTrigonometry.h.

template<typename Unit>
const Angle& crn::Angle< Unit >::operator+= ( const Angle< Unit > &  other)
inlinenoexcept

Adds an angle.

Definition at line 197 of file CRNTrigonometry.h.

template<typename Unit>
Angle crn::Angle< Unit >::operator- ( ) const
inlinenoexcept

Negative of the angle.

Definition at line 183 of file CRNTrigonometry.h.

template<typename Unit>
Angle crn::Angle< Unit >::operator- ( const Angle< Unit > &  other) const
inlinenoexcept

Subtracts an angle.

Definition at line 215 of file CRNTrigonometry.h.

template<typename Unit>
const Angle& crn::Angle< Unit >::operator-= ( typename Unit::type  angle)
inlinenoexcept

Subtracts an angle.

Definition at line 202 of file CRNTrigonometry.h.

template<typename Unit>
const Angle& crn::Angle< Unit >::operator-= ( const Angle< Unit > &  other)
inlinenoexcept

Subtracts an angle.

Definition at line 212 of file CRNTrigonometry.h.

template<typename Unit>
Angle& crn::Angle< Unit >::operator= ( const Angle< Unit > &  )
default
template<typename Unit>
Angle& crn::Angle< Unit >::operator= ( Angle< Unit > &&  )
default
template<typename Unit>
bool crn::Angle< Unit >::operator== ( const Angle< Unit > &  other) const
inlinenoexcept

Comparison operator.

Definition at line 233 of file CRNTrigonometry.h.

template<typename Unit>
static constexpr Angle<Unit> crn::Angle< Unit >::RIGHT ( )
inlinestatic

Angle facing right (automatically computed)

Definition at line 252 of file CRNTrigonometry.h.

template<typename Unit>
double crn::Angle< Unit >::Sin ( ) const
inlinenoexcept

Computes sine.

Definition at line 238 of file CRNTrigonometry.h.

template<typename Unit>
double crn::Angle< Unit >::Tan ( ) const
inlinenoexcept

Computes tangent.

Definition at line 240 of file CRNTrigonometry.h.

template<typename Unit>
static constexpr Angle<Unit> crn::Angle< Unit >::TOP ( )
inlinestatic

Angle facing top (automatically computed)

Definition at line 253 of file CRNTrigonometry.h.

Member Data Documentation

template<typename Unit>
Unit::type crn::Angle< Unit >::value

The value of the angle

Definition at line 256 of file CRNTrigonometry.h.


The documentation for this struct was generated from the following file: