00001 #ifndef __VECTOR2D_HPP__ 00002 #define __VECTOR2D_HPP__ 00003 00004 #include <iostream> 00005 #include <cmath> 00006 00014 class Vector2D { 00015 protected: 00016 double a, b; //< wspolczynniki wektora */ 00017 00018 public: 00022 Vector2D(); 00023 00027 Vector2D(double a_, double b_); 00028 00035 double distance(Vector2D vec); 00036 00044 Vector2D move(double alpha, double dist); 00045 00051 double module(); 00052 00058 double argument(); 00059 00060 Vector2D& operator= (const Vector2D &vec); 00061 Vector2D& operator+ (const Vector2D &vec); 00062 Vector2D& operator- (const Vector2D &vec); 00063 Vector2D& operator/ (const int value); 00064 Vector2D& operator/ (const double value); 00065 Vector2D& operator* (const int value); 00066 Vector2D& operator* (const double value); 00067 bool operator== (const Vector2D &vec1) const; 00068 bool operator!= (const Vector2D &vec) const; 00069 double& operator[] (unsigned int idx); 00070 double operator[] (unsigned int idx) const; 00071 }; 00072 00073 #endif 00074