Classes | Functions

point2.h File Reference

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

Go to the source code of this file.

Classes

class   Point2

Functions

Point2  operator+ (const Point2 &a, float f)
GEOMEXPORT float  Length (const Point2 &)
GEOMEXPORT int  MaxComponent (const Point2 &)
GEOMEXPORT int  MinComponent (const Point2 &)
GEOMEXPORT Point2  Normalize (const Point2 &)
GEOMEXPORT Point2  operator* (float, const Point2 &)
GEOMEXPORT Point2  operator* (const Point2 &, float)
GEOMEXPORT Point2  operator/ (const Point2 &, float)
GEOMEXPORT std::ostream &  operator<< (std::ostream &, const Point2 &)
float  LengthSquared (const Point2 &v)

Function Documentation

Point2 operator+ ( const Point2 a,
float  f 
) [inline]
Remarks:
Returns a copy of the Point2 argument offset by (f, f).

Definition at line 179 of file point2.h.

                                                  {
   return(Point2(a.x+f, a.y+f));
   }
float Length ( const Point2 v ) [inline]
Remarks:
Returns the length of the Point2, ie:

sqrt(v.x*v.x+v.y*v.y);

Definition at line 208 of file point2.h.

                                     {  
    return (float)sqrt(v.x*v.x+v.y*v.y);
    }
GEOMEXPORT int MaxComponent ( const Point2 )
Remarks:
Returns the component with the maximum absolute value. 0=x, 1=y.
GEOMEXPORT int MinComponent ( const Point2 )
Remarks:
Returns the component with the minimum absolute value. 0=x, 1=y.
GEOMEXPORT Point2 Normalize ( const Point2 )
Remarks:
Returns a unit vector. This is a Point2 with each component divided by the point Length().
Point2 operator* ( float  f,
const Point2 a 
) [inline]
Remarks:
Returns a Point2 multiplied by a scalar.

Definition at line 263 of file point2.h.

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

Definition at line 267 of file point2.h.

                                                  {
    return(Point2(a.x*f, a.y*f));
    }
Point2 operator/ ( const Point2 a,
float  f 
) [inline]
Remarks:
Returns a Point2 whose x and y members are divided by a scalar.

Definition at line 271 of file point2.h.

                                                  {
    return(Point2(a.x/f, a.y/f));
    }
GEOMEXPORT std::ostream& operator<< ( std::ostream &  ,
const Point2  
)
float LengthSquared ( const Point2 v ) [inline]
Remarks:
The 'Length' squared of the point. This is v.x*v.x+v.y*v.y.

Definition at line 218 of file point2.h.

                                            {   
    return (float)(v.x*v.x+v.y*v.y);
    }