DLAngle Class Reference

Representation of an angle in a DLImage. More...

#include <DLAngle.h>

List of all members.

Public Types

enum  DLAngleUnits { DL_DEGREES, DL_RADIANS, DL_GRADS }
enum  DLSpecialAngleType {
  DL_ARBITRARY, DL_ZERO_ANGLE, DL_45_DEGREE_ANGLE, DL_RIGHT_ANGLE,
  DL_135_DEGREE_ANGLE, DL_STRAIGHT_ANGLE
}
enum  DLQuadrant {
  DL_QUADRANT_UNDEFINED, DL_QUADRANT_I, DL_QUADRANT_II, DL_QUADRANT_III,
  DL_QUADRANT_IV
}

Public Member Functions

 DLAngle ()
 DLAngle (const DLAngle &orig)
const DLAngleoperator= (const DLAngle &right)
virtual ~DLAngle ()
 DLAngle (double radians)
 DLAngle (double value, DLAngleUnits units)
 DLAngle (double degrees, double minutes, double seconds)
 DLAngle (DLSpecialAngleType type)
double dlRadians () const
double dlDegrees () const
double dlGrads () const
bool dlIsSpecial () const
DLSpecialAngleType dlGetSpecialAngleType () const
DLQuadrant dlQuadrant () const
const DLAngleoperator+= (const DLAngle &p2)
const DLAngleoperator-= (const DLAngle &p2)
const DLAngle operator- () const
bool operator== (const DLAngle &p2) const
 operator double () const
void dlReduce ()

Friends

DLAngle operator+ (const DLAngle &p1, const DLAngle &p2)
 The sum of two DLAngles.
DLAngle operator- (const DLAngle &p1, const DLAngle &p2)
 The difference of two DLAngles.


Detailed Description

Representation of an angle in a DLImage.

A representation of an angle measured from the horizontal (positive x-axis) in the counterclockwise direction.

Definition at line 11 of file DLAngle.h.


Member Enumeration Documentation

enum DLAngle::DLAngleUnits

A selection of possible units of measure for an angle.

Enumerator:
DL_DEGREES 
DL_RADIANS 
DL_GRADS 

Definition at line 56 of file DLAngle.h.

enum DLAngle::DLSpecialAngleType

Some commonly-used specific values for angles. Some algorithms may check for this attribute of an inputted angle to simplify their calculations.

A DLAngle is not marked as special unless specifically constructed that way; therefore, only the first of these otherwise equivalent DLAngles is "special":

In general, the output of operations (such as +, -, += and -=) on special DLAngles will no longer be special. In the following example,

 DLAngle right(DLAngle::DL_RIGHT_ANGLE);
 DLAngle straight = right + right;
even though the sum of two right angles is a straight angle, the angle straight will not be marked with a DLSpecialAngleType.
Enumerator:
DL_ARBITRARY  An arbitrary angle; indicates that no special processing of this angle will take place, and that processing will proceed based on the angle value alone.
DL_ZERO_ANGLE  An angle of 0 degrees.
DL_45_DEGREE_ANGLE  A 45-degree angle / $ \pi/4 $ radians.
DL_RIGHT_ANGLE  A 90-degree / $ \pi/2 $-radian angle.
DL_135_DEGREE_ANGLE  A 135-degree / $ 3\pi / 4 $-radian angle.
DL_STRAIGHT_ANGLE  A 180-degree, or $ \pi $-radian angle.

Definition at line 85 of file DLAngle.h.

enum DLAngle::DLQuadrant

The four quadrants of a Cartesian coordinate system.

Enumerator:
DL_QUADRANT_UNDEFINED  An angle for which the quadrant is not defined; i.e. an angle lying on one of the coordinate axes; i.e. an angle of exactly 0, 90, 180 or 270 degrees.
DL_QUADRANT_I  An angle between 0 and 90 degrees.
DL_QUADRANT_II  An angle between 90 and 180 degrees.
DL_QUADRANT_III  An angle between 180 and 270 degrees.
DL_QUADRANT_IV  An angle between 270 and 0/360 degrees.

Definition at line 112 of file DLAngle.h.


Constructor & Destructor Documentation

DLAngle::DLAngle (  )  [inline]

Default DLAngle constructor; creates an angle of 0 radians.

Definition at line 21 of file DLAngle.h.

Referenced by operator-().

DLAngle::DLAngle ( const DLAngle orig  )  [inline]

DLAngle copy constructor.

Parameters:
orig DLAngle to copy

Definition at line 29 of file DLAngle.h.

virtual DLAngle::~DLAngle (  )  [inline, virtual]

DLAngle destructor.

Definition at line 45 of file DLAngle.h.

DLAngle::DLAngle ( double  radians  ) 

Constructor: Creates a DLAngle from a value in radians.

DLAngle::DLAngle ( double  value,
DLAngleUnits  units 
)

Constructor: Creates a DLAngle from a value in any of the typical representations.

Examples:

 DLAngle theta1(30, DLAngle::DL_DEGREES);
 DLAngle theta2(DL_PI_OVER_2, DLAngle::DL_RADIANS);

DLAngle::DLAngle ( double  degrees,
double  minutes,
double  seconds 
)

Constructor: Creates a DLAngle from the degrees-minutes-seconds representation.

DLAngle::DLAngle ( DLSpecialAngleType  type  ) 

Constructor: Creates one of several particular DLAngles.

Example:


Member Function Documentation

const DLAngle& DLAngle::operator= ( const DLAngle right  )  [inline]

Assignment operator.

Parameters:
right DLAngle to copy

Definition at line 35 of file DLAngle.h.

References angle, and specialType.

double DLAngle::dlRadians (  )  const

Returns:
The measure of the angle in radians.

double DLAngle::dlDegrees (  )  const

Returns:
The measure of the angle in degrees.

double DLAngle::dlGrads (  )  const

Returns:
The measure of the angle in grads.

bool DLAngle::dlIsSpecial (  )  const

Returns:

DLSpecialAngleType DLAngle::dlGetSpecialAngleType (  )  const [inline]

Returns:
The special value of an angle; or DLAngle::DL_ARBITRARY otherwise.

Definition at line 190 of file DLAngle.h.

DLQuadrant DLAngle::dlQuadrant (  )  const

Returns:
The quadrant of the angle in the cartesian coordinate system.

const DLAngle& DLAngle::operator+= ( const DLAngle p2  ) 

Counterclockwise angle rotation.

Parameters:
p2 DLAngle to rotate by

const DLAngle& DLAngle::operator-= ( const DLAngle p2  ) 

Clockwise angle rotation.

Parameters:
p2 DLAngle to rotate by

const DLAngle DLAngle::operator- (  )  const [inline]

Reflection across the x-axis.

Definition at line 212 of file DLAngle.h.

References DLAngle().

bool DLAngle::operator== ( const DLAngle p2  )  const [inline]

Equality operator (compare two angles)

Parameters:
p2 DLAngle to compare to

Definition at line 233 of file DLAngle.h.

References angle, and specialType.

DLAngle::operator double (  )  const [inline]

Conversion to double operator.

Allows an angle to be used as input to functions that require input of type double, for example:

 DLAngle theta;
 double length;
 ...
 double y = length * sin(theta);
 cout << "angle theta, in radians: " << theta << endl;
Returns:
Measure of the angle in radians.

Definition at line 252 of file DLAngle.h.

void DLAngle::dlReduce (  ) 

Convert the DLAngle to an angle in the range $ [0,2\pi) $ radians.


Friends And Related Function Documentation

DLAngle operator+ ( const DLAngle p1,
const DLAngle p2 
) [friend]

The sum of two DLAngles.

DLAngle operator- ( const DLAngle p1,
const DLAngle p2 
) [friend]

The difference of two DLAngles.


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

DOCLIB is being developed under contract by a collaboration between:
The Laboratory for Language and Media Processing
Unviersity of Maryland, College Park
and
Booz | Allen | Hamilton

All Rights Reserved, 2003-2007