home *** CD-ROM | disk | FTP | other *** search
- #ifndef __PLACE2D_H__
- #define __PLACE2D_H__
-
- struct Place2D
- {
- double x;
- double y;
- Place2D()
- {}
- Place2D(const Place2D & p)
- : x( p.x ),
- y( p.y )
- {}
- Place2D(double x, double y)
- : x( x ),
- y( y )
- {}
- const Place2D & operator+=(const Place2D & pl)
- {
- x += pl.x;
- y += pl.y;
- return *this;
- }
- const Place2D & operator-=(const Place2D & pl)
- {
- x -= pl.x;
- y -= pl.y;
- return *this;
- }
- };
-
- inline Place2D operator+ (const Place2D & pl1, const Place2D & pl2)
- {
- return Place2D(pl1) += pl2;
- }
-
- inline Place2D operator- (const Place2D & pl1, const Place2D & pl2)
- {
- return Place2D(pl1) -= pl2;
- }
-
- #endif //__PLACE2D_H__