#include "PlanimetryCalculus.h" PlanimetryCalculus::PlanimetryCalculus() { } /*! \fn void PlanimetryCalculus::rotatePoint(QPointF &point, double alpha) Rotates the \a point counter clockwisely by the angle \a alpha (in radiants). */ void PlanimetryCalculus::rotatePoint(QPointF &point, double alpha) { double x = point.x(); double y = point.y(); point.setX(x*qCos(alpha) - y*qSin(alpha)); point.setY(x*qSin(alpha) + y*qCos(alpha)); } /*! \fn void PlanimetryCalculus::rotatePointDegree(QPointF &point, double alpha) Rotates the \a point counter clockwisely by the angle \a alpha (in degrees). */ void PlanimetryCalculus::rotatePointDegree(QPointF &point, double alpha) { rotatePoint(point, alpha/180*M_PI); } /*! \fn PlanimetryCalculus::IntersectType PlanimetryCalculus::intersects(const Circle &circle1, const Circle &circle2) Returns the intersection type of the two cirles \a circle1 and \a circle2. \sa Circle */ PlanimetryCalculus::IntersectType PlanimetryCalculus::intersects(const Circle &circle1, const Circle &circle2) { double r1 = circle1.radius(); double r2 = circle2.radius(); double d = distance(circle1.origin(), circle2.origin()); //go on here } /*! \fn double PlanimetryCalculus::distance(const QPointF &p1, const QPointF p2) Calculates the distance (2-norm) between \a p1 and \a p2. \sa QPointF */ double PlanimetryCalculus::distance(const QPointF &p1, const QPointF p2) { double dx = p1.x()-p2.x(); double dy = p1.y()-p2.y(); return qSqrt(dx*dx+dy*dy); } /*! \class PlanimetryCalculus \inmodule Wima \brief The \c PlanimetryCalculus class provides routines handy for planimetrical (2D) calculations. */