#include <ipoint2.h>
Class Description
- See also:
- Class Point2.
- Description:
- This class describes a 2D point using int x and y coordinates.
Methods are provided to add and subtract points, multiply and
divide by scalars, normalize and compute the dot product of two
IPoint2s. All methods are implemented by the system.
- Data Members:
- int x,y;
Constructor & Destructor Documentation
{ x = af[0]; y = af[1]; }
Member Function Documentation
int& operator[] |
( |
int |
i |
) |
[inline] |
- Returns:
- An index of 0 will return x, 1 will return y.
const int& operator[] |
( |
int |
i |
) |
const [inline] |
- Returns:
- An index of 0 will return x, 1 will return y.
operator int * |
( |
|
) |
[inline] |
IPoint2 operator- |
( |
|
) |
const [inline] |
IPoint2 operator+ |
( |
|
) |
const [inline] |
{
x -= a.x; y -= a.y;
return *this;
}
{
x += a.x; y += a.y;
return *this;
}
IPoint2 & operator*= |
( |
int |
f |
) |
[inline] |
{
x *= f; y *= f;
return *this;
}
IPoint2 & operator/= |
( |
int |
f |
) |
[inline] |
{
x /= f; y /= f;
return *this;
}
int DotProd |
( |
const IPoint2 & |
b |
) |
const [inline] |
int operator* |
( |
const IPoint2 & |
b |
) |
const [inline] |
int operator== |
( |
const IPoint2 & |
p |
) |
const [inline] |
- Returns:
- Nonzero if the IPoint2's are equal; otherwise 0.
{ return (x == p.x && y == p.y); }
int operator!= |
( |
const IPoint2 & |
p |
) |
const [inline] |
{ return (x != p.x || y != p.y); }
Member Data Documentation