29.07.2011 - fundamental new

This commit is contained in:
peri4
2011-07-29 08:17:24 +04:00
parent b21a0496cd
commit 29190ea465
49 changed files with 4704 additions and 1052 deletions

View File

@@ -17,6 +17,8 @@ public:
inline PIPoint<Type> & move(const PIPoint<Type> & p) {x += p.x; y += p.y; return *this;}
inline double angleRad() const {return atan2(y, x);}
inline int angleDeg() const {return round(atan2(y, x) * 180. / M_PI);}
inline PIPoint<Type> toPolar(bool isDeg = false) const {return PIPoint<Type>(sqrt(x*x + y*y), isDeg ? angleDeg() : angleRad());}
inline static PIPoint<Type> fromPolar(const PIPoint<Type> & p) {return PIPoint<Type>(p.y * cos(p.x), p.y * sin(p.x));}
inline PIPoint<Type> operator +(const PIPoint<Type> & p) {return PIPoint<Type>(x + p.x, y + p.y);}
inline PIPoint<Type> operator +(const Type & p) {return PIPoint<Type>(x + p, y + p);}