Advertisement
Guest User

Untitled

a guest
Oct 24th, 2014
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.46 KB | None | 0 0
  1. #ifndef __v2d__
  2. #define __v2d__
  3.  
  4. class v2d{
  5. private:
  6.     double x, y;
  7. public:
  8.     // standard constructor
  9.     v2d(double x, double y);
  10.  
  11.     ~v2d(){};
  12.  
  13.     // copy constructor
  14.     v2d(const v2d & v);
  15.  
  16.     // assignment
  17.     v2d & operator=(const v2d &v);
  18.  
  19.     // vector addition
  20.     v2d & operator+(const v2d &v);
  21.  
  22.     // direct product
  23.     double operator*(const v2d &v);
  24.  
  25.     // scalar multiplication
  26.     v2d & operator*(double k);
  27.  
  28.     // length
  29.     double length();
  30.  
  31. };
  32.  
  33.  
  34. #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement