Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

mlib::XYvec Class Reference
["XY" Coordinate System]

A vector in XY coordinates. More...

#include <points.H>

Inheritance diagram for mlib::XYvec:

Inheritance graph
[legend]
Collaboration diagram for mlib::XYvec:

Collaboration graph
[legend]
List of all members.

Public Types

typedef double value_type

Public Member Functions

 Vec2 ()
 Vec2 (double x, double y)
XYvec operator+ (const XYvec &v) const
XYvec operator- (const XYvec &v) const
XYvec operator- () const
double operator * (const XYvec &v) const
XYvec operator * (double s) const
XYvec operator/ (double s) const
void operator+= (const XYvec &v)
void operator-= (const XYvec &v)
void operator *= (double s)
void operator/= (double s)
double operator[] (int index) const
double & operator[] (int index)
double length () const
double length_sqrd () const
bool is_exact_null () const
bool is_null (double epsSqrdMath=epsNorSqrdMath()) const
 Tells if the vector is basically the zero vector.
XYvec normalized () const
 Returns a unit-length copy of this vector.
XYvec perpend () const
 Returns a copy of the vector rotated 90 degrees CCW.
double dist (const XYvec &v) const
double dist_sqrd (const XYvec &v) const
double signed_angle (const XYvec &) const
 Returns the signed angle between this vector and the given one.
double angle (const XYvec &v) const
 Returns the unsigned angle between the two vectors. The result will lie between 0 and pi radians.
double tlen (const XYvec &b) const
 Return (this * b) / (b * b).
XYvec projected (const XYvec &b) const
 Returns the projection of this onto b.
XYvec orthogonalized (const XYvec &b) const
 Returns this vector minus its projection onto b.
bool is_equal (const XYvec &v, double epsSqrd=epsNorSqrdMath()) const
bool is_parallel (const XYvec &) const
bool operator== (const XYvec &v) const
bool operator!= (const XYvec &v) const
Constructors
 XYvec ()
 XYvec (double x, double y)
 XYvec (CNDCvec &)
 XYvec (CVEXEL &)

Static Public Member Functions

static CXYvecnull ()
static CXYvecX ()
static CXYvecY ()
static int dim ()

Protected Attributes

double _x
double _y

Static Protected Attributes

static CXYvec _null_vec
static CXYvec _x_axis
static CXYvec _y_axis

Detailed Description

A vector in XY coordinates.

Definition at line 534 of file points.H.


Member Typedef Documentation

typedef double mlib::Vec2< XYvec >::value_type [inherited]
 

Definition at line 47 of file vec2.H.


Constructor & Destructor Documentation

mlib::XYvec::XYvec  )  [inline]
 

Definition at line 547 of file points.H.

mlib::XYvec::XYvec double  x,
double  y
[inline]
 

Definition at line 548 of file points.H.

mlib::XYvec::XYvec CNDCvec  ) 
 

Definition at line 136 of file points.C.

References mlib::Vec2< XYvec >::_x, mlib::Vec2< XYvec >::_y, and VIEW_ASPECT.

mlib::XYvec::XYvec CVEXEL  ) 
 

Definition at line 166 of file points.C.

References mlib::Vec2< XYvec >::_x, mlib::Vec2< XYvec >::_y, and VIEW_SIZE.


Member Function Documentation

double mlib::Vec2< XYvec >::angle const XYvec v  )  const [inherited]
 

Returns the unsigned angle between the two vectors. The result will lie between 0 and pi radians.

static int mlib::Vec2< XYvec >::dim  )  [inline, static, inherited]
 

Definition at line 48 of file vec2.H.

double mlib::Vec2< XYvec >::dist const XYvec v  )  const [inline, inherited]
 

Definition at line 107 of file vec2.H.

double mlib::Vec2< XYvec >::dist_sqrd const XYvec v  )  const [inline, inherited]
 

Definition at line 108 of file vec2.H.

bool mlib::Vec2< XYvec >::is_equal const XYvec v,
double  epsSqrd = epsNorSqrdMath()
const [inline, inherited]
 

Definition at line 141 of file vec2.H.

bool mlib::Vec2< XYvec >::is_exact_null  )  const [inline, inherited]
 

Definition at line 84 of file vec2.H.

bool mlib::Vec2< XYvec >::is_null double  epsSqrdMath = epsNorSqrdMath()  )  const [inline, inherited]
 

Tells if the vector is basically the zero vector.

Definition at line 87 of file vec2.H.

bool mlib::Vec2< XYvec >::is_parallel const XYvec  )  const [inherited]
 

double mlib::Vec2< XYvec >::length  )  const [inline, inherited]
 

Definition at line 81 of file vec2.H.

double mlib::Vec2< XYvec >::length_sqrd  )  const [inline, inherited]
 

Definition at line 82 of file vec2.H.

XYvec mlib::Vec2< XYvec >::normalized  )  const [inherited]
 

Returns a unit-length copy of this vector.

static CXYvec& mlib::XYvec::null  )  [inline, static]
 

Definition at line 554 of file points.H.

References _null_vec.

XYvec mlib::Vec2< XYvec >::operator * double  s  )  const [inline, inherited]
 

Definition at line 60 of file vec2.H.

double mlib::Vec2< XYvec >::operator * const XYvec v  )  const [inline, inherited]
 

Definition at line 57 of file vec2.H.

void mlib::Vec2< XYvec >::operator *= double  s  )  [inline, inherited]
 

Definition at line 65 of file vec2.H.

bool mlib::Vec2< XYvec >::operator!= const XYvec v  )  const [inline, inherited]
 

Definition at line 151 of file vec2.H.

XYvec mlib::Vec2< XYvec >::operator+ const XYvec v  )  const [inline, inherited]
 

Definition at line 55 of file vec2.H.

void mlib::Vec2< XYvec >::operator+= const XYvec v  )  [inline, inherited]
 

Definition at line 63 of file vec2.H.

XYvec mlib::Vec2< XYvec >::operator-  )  const [inline, inherited]
 

Definition at line 58 of file vec2.H.

XYvec mlib::Vec2< XYvec >::operator- const XYvec v  )  const [inline, inherited]
 

Definition at line 56 of file vec2.H.

void mlib::Vec2< XYvec >::operator-= const XYvec v  )  [inline, inherited]
 

Definition at line 64 of file vec2.H.

XYvec mlib::Vec2< XYvec >::operator/ double  s  )  const [inline, inherited]
 

Definition at line 61 of file vec2.H.

void mlib::Vec2< XYvec >::operator/= double  s  )  [inline, inherited]
 

Definition at line 66 of file vec2.H.

bool mlib::Vec2< XYvec >::operator== const XYvec v  )  const [inline, inherited]
 

Definition at line 150 of file vec2.H.

double& mlib::Vec2< XYvec >::operator[] int  index  )  [inline, inherited]
 

Definition at line 74 of file vec2.H.

double mlib::Vec2< XYvec >::operator[] int  index  )  const [inline, inherited]
 

Definition at line 73 of file vec2.H.

XYvec mlib::Vec2< XYvec >::orthogonalized const XYvec b  )  const [inline, inherited]
 

Returns this vector minus its projection onto b.

Definition at line 134 of file vec2.H.

XYvec mlib::Vec2< XYvec >::perpend  )  const [inline, inherited]
 

Returns a copy of the vector rotated 90 degrees CCW.

Definition at line 100 of file vec2.H.

XYvec mlib::Vec2< XYvec >::projected const XYvec b  )  const [inline, inherited]
 

Returns the projection of this onto b.

Definition at line 131 of file vec2.H.

double mlib::Vec2< XYvec >::signed_angle const XYvec  )  const [inherited]
 

Returns the signed angle between this vector and the given one.

I.e., returns the angle by which to rotate this vector counter-clockwise to align with the given vector. The result will be negative if the smallest rotation to get to the given vector is in the clockwise direction. The result will lie between -pi and pi radians:

double mlib::Vec2< XYvec >::tlen const XYvec b  )  const [inline, inherited]
 

Return (this * b) / (b * b).

Definition at line 125 of file vec2.H.

mlib::Vec2< XYvec >::Vec2 double  x,
double  y
[inline, inherited]
 

Definition at line 40 of file vec2.H.

mlib::Vec2< XYvec >::Vec2  )  [inline, inherited]
 

Definition at line 39 of file vec2.H.

static CXYvec& mlib::XYvec::X  )  [inline, static]
 

Definition at line 555 of file points.H.

References _x_axis.

static CXYvec& mlib::XYvec::Y  )  [inline, static]
 

Definition at line 556 of file points.H.

References _y_axis.


Member Data Documentation

CXYvec mlib::XYvec::_null_vec [static, protected]
 

Definition at line 538 of file points.H.

Referenced by null().

double mlib::Vec2< XYvec >::_x [protected, inherited]
 

Definition at line 32 of file vec2.H.

Referenced by XYvec().

CXYvec mlib::XYvec::_x_axis [static, protected]
 

Definition at line 539 of file points.H.

Referenced by X().

double mlib::Vec2< XYvec >::_y [protected, inherited]
 

Definition at line 32 of file vec2.H.

Referenced by XYvec().

CXYvec mlib::XYvec::_y_axis [static, protected]
 

Definition at line 540 of file points.H.

Referenced by Y().


The documentation for this class was generated from the following files:
Generated on Mon Sep 18 11:48:16 2006 for jot by  doxygen 1.4.4