11 QString qpointToString (const QPoint &p)
12 { return "(" + QString("%1").arg(p.x()) +","+ QString ("%1").arg (p.y()) +")"; }
14 QString qpointFToString (const QPointF &p)
15 { return "(" + QString("%1").arg(p.x()) +","+ QString ("%1").arg (p.y()) +")"; }
17 QString VectorToString (const Vector &p)
18 { return "(" + QString("%1").arg(p.x()) +","+ QString ("%1").arg (p.y()) +")"; }
20 ostream &operator<< (ostream &stream, QPoint const &p)
22 stream << "("<<p.x()<<","<<p.y()<<")";
26 ostream &operator<< (ostream &stream, QPointF const &p)
28 stream << "("<<p.x()<<","<<p.y()<<")";
32 ostream &operator<< (ostream &stream, Vector const &p)
34 stream << "("<<p.x()<<","<<p.y()<<")";
38 qreal getAngle(const QPointF &p)
40 // Calculate angle of vector to y-axis
50 return (qreal)(M_PI - atan ( (qreal)(p.x()) / (qreal)(p.y()) ) );
53 return (qreal)( 2*M_PI - atan ( (qreal)(p.x()) / (qreal)(p.y()) ) );
55 return (qreal)( - atan ( (qreal)(p.x()) / (qreal)(p.y()) ) );
59 qreal max(qreal a, qreal b)