geometric::angle< contents > Class Template Reference

Represents a geometric angle. More...

#include <angle.h>

Inheritance diagram for geometric::angle< contents >:

Inheritance graph
[legend]
Collaboration diagram for geometric::angle< contents >:

Collaboration graph
[legend]
List of all members.

Public Types

enum  angular_units { DEGREES, RADIANS }
 angles can be measured in degrees or radians in this class. More...

Public Member Functions

 angle (contents inital_rotation=0, angular_units unit=RADIANS)
 constructs a new angle with "initial_rotation" in the "unit".
void set (contents a, angular_units unit)
 sets the angle to a new rotation "a" in the "unit".
contents get (angular_units unit) const
 retrieves the current angular measure.
angle operator- (void) const
 returns the negation of this angle.
angle operator+ (const angle &to_add) const
angle operator- (const angle &to_subtract) const
angle operator * (contents to_multiply) const
angle operator/ (contents to_divide) const
angleoperator+= (const angle &to_add)
angleoperator-= (const angle &to_subtract)
angleoperator *= (contents to_multiply)
angleoperator/= (contents to_divide)
contents sine () const
 returns the sin function of this angle.
contents cosine () const
 returns the cos function of this angle.
contents tangent () const
 returns the tan function of this angle.
virtual void pack (byte_array &packed_form) const
 packs the angle for shipping in bytes.
virtual bool unpack (byte_array &packed_form)
 unpacks the angle from the "packed_form".

Static Public Member Functions

static angle arctangent (contents opposite, contents adjacent, outcome &retval)
 returns the atan of the angle.
static angle arccosine (contents adjacent, contents hypotenuse, outcome &retval)
 returns the acos of the angle.
static angle arcsine (contents opposite, contents hypotenuse, outcome &retval)
 returns the asin of the angle.

Detailed Description

template<class contents>
class geometric::angle< contents >

Represents a geometric angle.

Definition at line 25 of file angle.h.


Member Enumeration Documentation

template<class contents>
enum geometric::angle::angular_units

angles can be measured in degrees or radians in this class.

Enumerator:
DEGREES 
RADIANS 

Definition at line 29 of file angle.h.


Constructor & Destructor Documentation

template<class contents>
geometric::angle< contents >::angle ( contents  inital_rotation = 0,
angular_units  unit = RADIANS 
)

constructs a new angle with "initial_rotation" in the "unit".

Definition at line 28 of file angle.cpp.

References geometric::angle< contents >::set().


Member Function Documentation

template<class contents>
void geometric::angle< contents >::set ( contents  a,
angular_units  unit 
)

sets the angle to a new rotation "a" in the "unit".

Definition at line 108 of file angle.cpp.

Referenced by geometric::angle< contents >::angle().

template<class contents>
contents geometric::angle< contents >::get ( angular_units  unit  )  const

retrieves the current angular measure.

Definition at line 112 of file angle.cpp.

Referenced by geometric::ellipse::location(), and geometric::circle::location().

template<class contents>
angle< contents > geometric::angle< contents >::operator- ( void   )  const

returns the negation of this angle.

Definition at line 31 of file angle.cpp.

template<class contents>
angle< contents > geometric::angle< contents >::operator+ ( const angle< contents > &  to_add  )  const

Definition at line 35 of file angle.cpp.

template<class contents>
angle< contents > geometric::angle< contents >::operator- ( const angle< contents > &  to_subtract  )  const

Definition at line 39 of file angle.cpp.

template<class contents>
angle< contents > geometric::angle< contents >::operator * ( contents  to_multiply  )  const

Definition at line 43 of file angle.cpp.

template<class contents>
angle< contents > geometric::angle< contents >::operator/ ( contents  to_divide  )  const

Definition at line 51 of file angle.cpp.

template<class contents>
angle< contents > & geometric::angle< contents >::operator+= ( const angle< contents > &  to_add  ) 

Definition at line 55 of file angle.cpp.

References geometric::angle< contents >::_theta.

template<class contents>
angle< contents > & geometric::angle< contents >::operator-= ( const angle< contents > &  to_subtract  ) 

Definition at line 59 of file angle.cpp.

References geometric::angle< contents >::_theta.

template<class contents>
angle< contents > & geometric::angle< contents >::operator *= ( contents  to_multiply  ) 

Definition at line 63 of file angle.cpp.

template<class contents>
angle< contents > & geometric::angle< contents >::operator/= ( contents  to_divide  ) 

Definition at line 67 of file angle.cpp.

template<class contents>
contents geometric::angle< contents >::sine (  )  const

returns the sin function of this angle.

Definition at line 71 of file angle.cpp.

Referenced by geometric::point< numeric_type >::rotate(), and geometric::point< numeric_type >::set().

template<class contents>
contents geometric::angle< contents >::cosine (  )  const

returns the cos function of this angle.

Definition at line 74 of file angle.cpp.

Referenced by geometric::point< numeric_type >::rotate(), and geometric::point< numeric_type >::set().

template<class contents>
contents geometric::angle< contents >::tangent (  )  const

returns the tan function of this angle.

Definition at line 77 of file angle.cpp.

Referenced by geometric::ellipse::location().

template<class contents>
angle< contents > geometric::angle< contents >::arctangent ( contents  opposite,
contents  adjacent,
outcome retval 
) [static]

returns the atan of the angle.

the outcome will be set to OKAY if the function operated successfully. otherwise it will be set to BAD_INPUT.

Definition at line 138 of file angle.cpp.

References common::BAD_INPUT, and common::OKAY.

template<class contents>
angle< contents > geometric::angle< contents >::arccosine ( contents  adjacent,
contents  hypotenuse,
outcome retval 
) [static]

returns the acos of the angle.

Definition at line 116 of file angle.cpp.

References common::BAD_INPUT, bounds_return, and common::OKAY.

template<class contents>
angle< contents > geometric::angle< contents >::arcsine ( contents  opposite,
contents  hypotenuse,
outcome retval 
) [static]

returns the asin of the angle.

Definition at line 127 of file angle.cpp.

References common::BAD_INPUT, bounds_return, and common::OKAY.

template<class contents>
void geometric::angle< contents >::pack ( byte_array packed_form  )  const [virtual]

packs the angle for shipping in bytes.

Implements packable.

Definition at line 80 of file angle.cpp.

References basis::attach().

template<class contents>
bool geometric::angle< contents >::unpack ( byte_array packed_form  )  [virtual]

unpacks the angle from the "packed_form".

Implements packable.

Definition at line 84 of file angle.cpp.

References basis::detach().


The documentation for this class was generated from the following files:
Generated on Fri Oct 10 04:30:39 2008 for HOOPLE Libraries by  doxygen 1.5.1