GenLib2::UnitAngle Class Reference

Unit angle class. More...

#include <uangle.h>

Inheritance diagram for GenLib2::UnitAngle:

GenLib2::Angle

List of all members.

get rho.

Get scale factor rho to convert from the actual unit into the SI-base unit radian.

The division of the angle by rho results to the equivalent angle in radian.

Parameters:
code 
Returns:
scale factor


ecode _code
 code
double _rho
 scale factor rho
static const int _map_size = 8
 map size
static map_t _map []
 map
void print (ostream &os) const
 print map
static double rho (int code)

Public Types

enum  ecode {
  UNKNOWN, NONE, RADIAN, DEGREE,
  HOUR, MINUTE, SECOND, GON
}
 code of unit More...

Public Member Functions

set unit using symbol-string.
Parameters:
symbol 
Returns:
true = OK, false = error occured


bool set (const char *symbol)
 UnitAngle ()
 default constructor
constructor using symbol-string.
Parameters:
symbol 


 UnitAngle (const char *symbol)
virtual ~UnitAngle ()
 destructor
get rho.
Returns:
scale factor


double rho () const
get symbol-string.
Returns:
symbol


const char * symbol () const

Static Public Member Functions

get code.
Parameters:
symbol 
Returns:
code


static ecode code (const char *symbol)
get name.
Parameters:
code 
Returns:
name


static const char * name (int code)
get symbol.
Parameters:
code 
Returns:
symbol


static const char * symbol (int code)

Classes

struct  map_t
 map structure More...


Detailed Description

Unit angle class.

Measurements of plane angles. Supported units: radian, decimal degrees, decimal minute, decimal second, hours and gon (grad).

Author:
Dirk Stallmann

Member Enumeration Documentation

code of unit

Enumerator:
UNKNOWN  unknown
NONE  without unit is like radian
RADIAN  radian
DEGREE  degree
HOUR  hour or angular hour
MINUTE  minute or angular minute
SECOND  second or angular second
GON  gon or grad


Member Data Documentation

Initial value:

{
    { UNKNOWN,  "unk",  "unkown",   0. },
    { NONE,     "none", "none",     1. },
    { RADIAN,   "rad",  "radian",   1. },
    { DEGREE,   "deg",  "degree",   180. / M_PI },
    { HOUR,     "hr",   "hour",     12. / M_PI },
    { MINUTE,   "min",  "minute",   180. / M_PI / 60. },
    { SECOND,   "sec",  "second",   180. / M_PI / 3600. },
    { GON,      "gon",  "gon",      200. / M_PI }
}
map

Referenced by print().


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

Generated on Wed Aug 6 15:46:44 2008 by  doxygen 1.5.5