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_OSTREAM &  operator<< (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);
                                    {   
        return (int)sqrt((double)(v.x*v.x+v.y*v.y));
        }
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.
                                                  {
        return(IPoint2(a.x*f, a.y*f));
        }
IPoint2 operator* ( const IPoint2 a,
int  f 
) [inline]
Remarks:
Returns an IPoint2 multiplied by a scalar.
                                                  {
        return(IPoint2(a.x*f, a.y*f));
        }
IPoint2 operator/ ( const IPoint2 a,
int  f 
) [inline]
Remarks:
Returns an IPoint2 whose x and y members are divided by a scalar.
                                                  {
        return(IPoint2(a.x/f, a.y/f));
        }
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.
{ return(p.x>p.y?0:1); }
int MinComponent ( const IPoint2 p ) [inline]
Remarks:
Returns the component with the minimum abs value. 0=x, 1=y.
{ return(p.x<p.y?0:1); }