cartesian coordinates

guys i need help with defining cartesian coordinates in c++ for a rectangle....
declare a point structure with int x, int y as its members (add int z if three d).
use object of this structure to represent a point in your cartesian system
can you give me an example of writing a program for a rectangle using cartesian coordinates?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
struct 3dPoint
{
    int x,
    int y;
    int z;

    3dPoint() : x(0), y(0), z(0) {};
};

struct 3dRectangle
{
    3DPoint LT; //left top point
    3DPoint RB; //right bottom point
};


If you need to learn how about program structure and general help then read http://www.cplusplus.com/doc/tutorial/
[/code]
Topic archived. No new replies allowed.