ETL  0.04.19
Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Types | Protected Attributes | Friends | List of all members
angle Class Reference

Abstraction of the concept of an angle. More...

#include <ETL/angle>

Inheritance diagram for angle:
angle::cos angle::deg angle::rad angle::rot angle::sin angle::tan

Classes

class  cos
 Angle representation as a cosine function. More...
class  deg
 Angle representation in degrees. More...
class  rad
 Angle representation in radians. More...
class  rot
 Angle representation in rotations. More...
class  sin
 Angle representation as a sine function. More...
class  tan
 Angle representation as a tangent function. More...

Public Types

typedef float value_type

Public Member Functions

const angleoperator+= (const angle &rhs)
 Stored in radians; positive values indicate counter-clockwise.
const angleoperator-= (const angle &rhs)
const angleoperator*= (const unit &rhs)
const angleoperator/= (const unit &rhs)
angle operator+ (const angle &rhs) const
 Angle Addition Operator.
angle operator- (const angle &rhs) const
 Angle Subtraction Operator.
angle operator* (const unit &rhs) const
 Angle Scalar Multiplication Operator.
angle operator/ (const unit &rhs) const
angle operator- () const
 Angle Negation.
bool operator< (const angle &rhs) const
bool operator> (const angle &rhs) const
bool operator<= (const angle &rhs) const
bool operator>= (const angle &rhs) const
bool operator== (const angle &rhs) const
bool operator!= (const angle &rhs) const
angle abs () const
 Absolute Angle Function.
angle dist (const angle &rhs) const
 Angle Difference Function.
angle mod () const
 Rotation Modulus.
bool operator! () const

Static Public Member Functions

static angle zero ()
 Zero Rotation (0 degrees)
static angle one ()
 One Complete Rotation (360 degrees)
static angle half ()
 One Half Rotation (180 degrees)

Protected Types

typedef value_type unit

Protected Attributes

unit v

Friends

class rad
class deg
class rot
class sin
class cos
class tan

Detailed Description

Abstraction of the concept of an angle.

See Also
angle::deg, angle::rad, angle::rot, angle::sin, angle::cos, angle::tan, fastangle
Todo:
This needs to be documented

Definition at line 58 of file _angle.h.

Member Typedef Documentation

typedef float angle::value_type

Definition at line 61 of file _angle.h.

typedef value_type angle::unit
protected

Definition at line 64 of file _angle.h.

Member Function Documentation

const angle& angle::operator+= ( const angle rhs)
inline

Stored in radians; positive values indicate counter-clockwise.

Definition at line 75 of file _angle.h.

References v.

const angle& angle::operator-= ( const angle rhs)
inline

Definition at line 79 of file _angle.h.

References v.

const angle& angle::operator*= ( const unit rhs)
inline

Definition at line 83 of file _angle.h.

References v.

const angle& angle::operator/= ( const unit rhs)
inline

Definition at line 87 of file _angle.h.

References v.

angle angle::operator+ ( const angle rhs) const
inline

Angle Addition Operator.

Definition at line 92 of file _angle.h.

angle angle::operator- ( const angle rhs) const
inline

Angle Subtraction Operator.

See Also
angle dist(const angle &)

Definition at line 98 of file _angle.h.

angle angle::operator* ( const unit rhs) const
inline

Angle Scalar Multiplication Operator.

This operator will multiply the given angle by the given scalar value.

Definition at line 105 of file _angle.h.

angle angle::operator/ ( const unit rhs) const
inline

Definition at line 109 of file _angle.h.

angle angle::operator- ( ) const
inline

Angle Negation.

Definition at line 114 of file _angle.h.

References v.

bool angle::operator< ( const angle rhs) const
inline

Returns true if the left-hand side is less than the right-hand side

Definition at line 186 of file _angle.h.

References v.

bool angle::operator> ( const angle rhs) const
inline

Returns true if the left-hand side is greater than the right-hand side

Definition at line 193 of file _angle.h.

References v.

bool angle::operator<= ( const angle rhs) const
inline

Returns true if the left-hand side is less or equal to the right-hand side

Definition at line 200 of file _angle.h.

References v.

bool angle::operator>= ( const angle rhs) const
inline

Returns true if the left-hand side is greater than or equal to the right-hand side

Definition at line 207 of file _angle.h.

References v.

bool angle::operator== ( const angle rhs) const
inline

Returns true if the angles are the same, or close

Definition at line 213 of file _angle.h.

References abs(), ANGLE_EPSILON, and v.

bool angle::operator!= ( const angle rhs) const
inline

Returns false if the angles are different

Definition at line 219 of file _angle.h.

References abs(), ANGLE_EPSILON, and v.

angle angle::abs ( ) const
inline

Absolute Angle Function.

This function will return the absolute value of the angle.

Definition at line 227 of file _angle.h.

References v.

Referenced by operator!(), operator!=(), and operator==().

angle angle::dist ( const angle rhs) const
inline

Angle Difference Function.

This function will return the difference between two angles, just like

See Also
angle operator-(const angle &)

Reimplemented in angle::tan, angle::cos, angle::sin, angle::rot, angle::deg, and angle::rad.

Definition at line 266 of file _angle.h.

angle angle::mod ( ) const
inline

Rotation Modulus.

This function will return the value of the angle

Reimplemented in angle::tan, angle::cos, angle::sin, angle::rot, angle::deg, and angle::rad.

Definition at line 273 of file _angle.h.

Referenced by operator!().

static angle angle::zero ( )
inlinestatic

Zero Rotation (0 degrees)

Definition at line 282 of file _angle.h.

References v.

static angle angle::one ( )
inlinestatic

One Complete Rotation (360 degrees)

Definition at line 291 of file _angle.h.

References v.

static angle angle::half ( )
inlinestatic

One Half Rotation (180 degrees)

Definition at line 300 of file _angle.h.

References PI, and v.

bool angle::operator! ( ) const
inline

Definition at line 307 of file _angle.h.

References abs(), ANGLE_EPSILON, mod(), and v.

Friends And Related Function Documentation

friend class rad
friend

Definition at line 331 of file _angle.h.

friend class deg
friend

Definition at line 338 of file _angle.h.

friend class rot
friend

Definition at line 339 of file _angle.h.

friend class sin
friend

Definition at line 340 of file _angle.h.

friend class cos
friend

Definition at line 341 of file _angle.h.

friend class tan
friend

Definition at line 342 of file _angle.h.

Member Data Documentation

unit angle::v
protected

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