Coord Class Reference

Structure holding a 32-bit cartesian coordinate. More...

#include <coord.h>

Inheritance diagram for Coord:

DocCoord OilCoord UserCoord List of all members.

Public Member Functions

void translate (INT32 thatX, INT32 thatY)
 tranlates a Coord by thatX and thatY.
BOOL operator== (const Coord &) const
BOOL operator!= (const Coord &) const
double Distance (const Coord &) const
 Accurate distance function.
 Coord (INT32 x1, INT32 y1)
 Coord ()

Public Attributes

INT32 x
INT32 y

Friends

Coord operator- (const Coord &)

Detailed Description

Structure holding a 32-bit cartesian coordinate.

Author:
Mario_Shamtani (Xara Group Ltd) <camelotdev@xara.com>
Date:
20/5/1993
Returns:
Errors: None.

Definition at line 118 of file coord.h.


Constructor & Destructor Documentation

Coord::Coord INT32  x1,
INT32  y1
[inline]
 

Definition at line 133 of file coord.h.

00133 { x=x1; y=y1; }

Coord::Coord  )  [inline]
 

Definition at line 134 of file coord.h.

00134 {} 


Member Function Documentation

double Coord::Distance const Coord Coord  )  const
 

Accurate distance function.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
10/3/94
Parameters:
A coord [INPUTS]
None [OUTPUTS]
Returns:
the distance between this coord and the given coord

Errors: None.

Definition at line 120 of file coord.cpp.

00121 {
00122     double dx       = (double) (this->x-Coord.x);
00123     double dy       = (double) (this->y-Coord.y);
00124     double sumsqrs  = (dx*dx)+(dy*dy);
00125     
00126     return (sqrt(sumsqrs));
00127 }

BOOL Coord::operator!= const Coord  )  const [inline]
 

Definition at line 181 of file coord.h.

00182 {
00183     return ((input.x != x) || (input.y != y));
00184 }

BOOL Coord::operator== const Coord  )  const [inline]
 

Definition at line 174 of file coord.h.

00175 {
00176     return ((input.x == x) && (input.y == y));
00177 }

void Coord::translate INT32  thatX,
INT32  thatY
[inline]
 

tranlates a Coord by thatX and thatY.

Author:
Mario_Shamtani (Xara Group Ltd) <camelotdev@xara.com>
Date:
21/5/93
Parameters:
translation coordinates. [INPUTS]
None [OUTPUTS]
Returns:
None.

Errors: None.

Definition at line 155 of file coord.h.

00156 {
00157     this->x += thatX;
00158     this->y += thatY;
00159 }


Friends And Related Function Documentation

Coord operator- const Coord input  )  [friend]
 

Definition at line 163 of file coord.h.

00164 {
00165 Coord result;
00166 
00167     result.x = -input.x;
00168     result.y = -input.y;
00169     return result;
00170 }


Member Data Documentation

INT32 Coord::x
 

Definition at line 121 of file coord.h.

INT32 Coord::y
 

Definition at line 122 of file coord.h.


The documentation for this class was generated from the following files:
Generated on Sat Nov 10 03:53:11 2007 for Camelot by  doxygen 1.4.4