Classes | Functions

ipoint2.h File Reference

#include "GeomExport.h"
#include "maxheap.h"
#include <iosfwd>
#include <math.h>

Go to the source code of this file.

Classes

class   IPoint2

Functions

GEOMEXPORT int  Length (const IPoint2 &)
GEOMEXPORT IPoint2  Normalize (const IPoint2 &)
GEOMEXPORT IPoint2  operator* (int, const IPoint2 &)
GEOMEXPORT IPoint2  operator* (const IPoint2 &, int)
GEOMEXPORT IPoint2  operator/ (const IPoint2 &, int)
GEOMEXPORT std::ostream &  operator<< (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);

Definition at line 117 of file ipoint2.h.

                                    {   
    return (int)sqrt((double)(v.x*v.x+v.y*v.y));
    }
GEOMEXPORT 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.

Definition at line 157 of file ipoint2.h.

                                                  {
    return(IPoint2(a.x*f, a.y*f));
    }
IPoint2 operator* ( const IPoint2 a,
int  f 
) [inline]
Remarks:
Returns an IPoint2 multiplied by a scalar.

Definition at line 161 of file ipoint2.h.

                                                  {
    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.

Definition at line 165 of file ipoint2.h.

                                                  {
    return(IPoint2(a.x/f, a.y/f));
    }
GEOMEXPORT std::ostream& operator<< ( std::ostream &  ,
const IPoint2  
)
int MaxComponent ( const IPoint2 p ) [inline]
Remarks:
Returns the component with the minimum abs value. 0=x, 1=y.

Definition at line 113 of file ipoint2.h.

{ 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.

Definition at line 115 of file ipoint2.h.

{ return(p.x<p.y?0:1); }