ipoint2.h File Reference

ipoint2.h File Reference
#include "GeomExport.h"
#include "maxheap.h"
#include "strbasic.h"
#include <iosfwd>
#include <math.h>

Classes

class  IPoint2
 

Functions

int Length (const IPoint2 &)
 
IPoint2 Normalize (const IPoint2 &)
 
IPoint2 operator* (int, const IPoint2 &)
 
IPoint2 operator* (const IPoint2 &, int)
 
IPoint2 operator/ (const IPoint2 &, int)
 
M_STD_OSTREAMoperator<< (M_STD_OSTREAM &, const IPoint2 &)
 
int MaxComponent (const IPoint2 &p)
 
int MinComponent (const IPoint2 &p)
 

Function Documentation

int Length ( const IPoint2 v)
inline
Remarks
Returns the length of the IPoint2, ie:

sqrt(v.x*v.x+v.y*v.y);
123  {
124  return (int)sqrt((double)(v.x*v.x+v.y*v.y));
125  }
int y
Definition: ipoint2.h:35
int x
Definition: ipoint2.h:35
IPoint2 Normalize ( const IPoint2 )
Remarks
Returns a unit vector. This is an IPoint2 with each component divided by the point Length().
IPoint2 operator* ( int  f,
const IPoint2 a 
)
inline
Remarks
Returns an IPoint2 multiplied by a scalar.
163  {
164  return(IPoint2(a.x*f, a.y*f));
165  }
int y
Definition: ipoint2.h:35
Definition: ipoint2.h:31
int x
Definition: ipoint2.h:35
IPoint2 operator* ( const IPoint2 a,
int  f 
)
inline
Remarks
Returns an IPoint2 multiplied by a scalar.
167  {
168  return(IPoint2(a.x*f, a.y*f));
169  }
int y
Definition: ipoint2.h:35
Definition: ipoint2.h:31
int x
Definition: ipoint2.h:35
IPoint2 operator/ ( const IPoint2 a,
int  f 
)
inline
Remarks
Returns an IPoint2 whose x and y members are divided by a scalar.
171  {
172  return(IPoint2(a.x/f, a.y/f));
173  }
int y
Definition: ipoint2.h:35
Definition: ipoint2.h:31
int x
Definition: ipoint2.h:35
M_STD_OSTREAM& operator<< ( M_STD_OSTREAM ,
const IPoint2  
)
int MaxComponent ( const IPoint2 p)
inline
Remarks
Returns the component with the minimum abs value. 0=x, 1=y.
119 { return(p.x>p.y?0:1); }
int y
Definition: ipoint2.h:35
int x
Definition: ipoint2.h:35
int MinComponent ( const IPoint2 p)
inline
Remarks
Returns the component with the minimum abs value. 0=x, 1=y.
121 { return(p.x<p.y?0:1); }
int y
Definition: ipoint2.h:35
int x
Definition: ipoint2.h:35