Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #ifndef __v2d__
- #define __v2d__
- class v2d{
- private:
- double x, y;
- public:
- // standard constructor
- v2d(double x, double y);
- ~v2d(){};
- // copy constructor
- v2d(const v2d & v);
- // assignment
- v2d & operator=(const v2d &v);
- // vector addition
- v2d & operator+(const v2d &v);
- // direct product
- double operator*(const v2d &v);
- // scalar multiplication
- v2d & operator*(double k);
- // length
- double length();
- };
- #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement