• API
• FAQ
• Tools
• Archive
SHARE
TWEET # Untitled Lera_rastaturina  Oct 21st, 2019 79 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
1. #pragma once
2. #include <cmath>
3. #include <cstring>
4.
5. using namespace std;
6.
7. class Vector2d
8. {
9. private:
10.     double x, y;
11. public:
12.     Vector2d();
13.     Vector2d(double, double);
14.     Vector2d(double, double, double, double);
15.     Vector2d(const Vector2d &);
16.     Vector2d operator+(const Vector2d & ) const;
17.     Vector2d operator-(const Vector2d & ) const;
18.     Vector2d operator*(const Vector2d & ) const;
19.     friend Vector2d operator*(double, Vector2d & );
20.     Vector2d& operator++();
21.     Vector2d operator++(int);
22.     Vector2d& operator--();
23.     Vector2d operator--(int);
24.     const Vector2d& operator += (const Vector2d &);
25.     const Vector2d& operator -= (const Vector2d &);
26.     const Vector2d& operator *= (const Vector2d &);
27.     operator string() const;
28.     void setX(double value)
29.     {
30.         x = value;
31.     }
32.
33.     double getX()
34.     {
35.         return x;
36.     }
37.
38.     void setY(double value)
39.     {
40.         y = value;
41.     }
42.
43.     double getY()
44.     {
45.         return y;
46.     }
47.
48.     void print(void);
49.     void sum(Vector2d);
50.     void sub(Vector2d);
51.     void mult(double);
52.     double scalarMult(Vector2d);
53.     ~Vector2d();
54. };
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy.

Top