ipoint2.h File Reference

ipoint2.h File Reference
#include "GeomExport.h"
#include "maxheap.h"
#include "strbasic.h"
#include "assert1.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);
124  {
125  return (int)sqrt((double)(v.x*v.x+v.y*v.y));
126  }
int y
Definition: ipoint2.h:36
int x
Definition: ipoint2.h:36
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.
171  {
172  return(IPoint2(a.x*f, a.y*f));
173  }
int y
Definition: ipoint2.h:36
Definition: ipoint2.h:32
int x
Definition: ipoint2.h:36
IPoint2 operator* ( const IPoint2 a,
int  f 
)
inline
Remarks
Returns an IPoint2 multiplied by a scalar.
175  {
176  return(IPoint2(a.x*f, a.y*f));
177  }
int y
Definition: ipoint2.h:36
Definition: ipoint2.h:32
int x
Definition: ipoint2.h:36
IPoint2 operator/ ( const IPoint2 a,
int  f 
)
inline
Remarks
Returns an IPoint2 whose x and y members are divided by a scalar.
179  {
180  return(IPoint2(a.x/f, a.y/f));
181  }
int y
Definition: ipoint2.h:36
Definition: ipoint2.h:32
int x
Definition: ipoint2.h:36
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.
120 { return(p.x>p.y?0:1); }
int y
Definition: ipoint2.h:36
int x
Definition: ipoint2.h:36
int MinComponent ( const IPoint2 p)
inline
Remarks
Returns the component with the minimum abs value. 0=x, 1=y.
122 { return(p.x<p.y?0:1); }
int y
Definition: ipoint2.h:36
int x
Definition: ipoint2.h:36