10 QString qpointToString (const QPoint &p)
11 { return "(" + QString("%1").arg(p.x()) +","+ QString ("%1").arg (p.y()) +")"; }
13 QString qpointFToString (const QPointF &p)
14 { return "(" + QString("%1").arg(p.x()) +","+ QString ("%1").arg (p.y()) +")"; }
16 QString VectorToString (const Vector &p)
17 { return "(" + QString("%1").arg(p.x()) +","+ QString ("%1").arg (p.y()) +")"; }
19 ostream &operator<< (ostream &stream, QPoint const &p)
21 stream << "("<<p.x()<<","<<p.y()<<")";
25 ostream &operator<< (ostream &stream, QPointF const &p)
27 stream << "("<<p.x()<<","<<p.y()<<")";
31 ostream &operator<< (ostream &stream, QRectF const &r)
33 stream << "tL="<<r.topLeft()<<" - (w,h)="<<r.width()<<","<<r.height()<<" bR="<<r.bottomRight();
37 ostream &operator<< (ostream &stream, Vector const &p)
39 stream << "("<<p.x()<<","<<p.y()<<")";
43 qreal getAngle(const QPointF &p)
45 // Calculate angle of vector to y-axis
55 return (qreal)(M_PI - atan ( (qreal)(p.x()) / (qreal)(p.y()) ) );
58 return (qreal)( 2*M_PI - atan ( (qreal)(p.x()) / (qreal)(p.y()) ) );
60 return (qreal)( - atan ( (qreal)(p.x()) / (qreal)(p.y()) ) );
64 qreal max(qreal a, qreal b)