PlanimetryCalculus.h 1.35 KB
Newer Older
1 2 3 4 5 6 7
#pragma once

#include <QLineF>
#include <QPointF>
#include <QtMath>
#include <QLineF>

8 9 10
class Circle;

namespace PlanimetryCalculus {
11

12 13 14
    enum IntersectType{InsideNoIntersection, InsideTouching, InsideIntersection,
                       OutsideIntersection, OutsideTouching, OutsideNoIntersection,
                       CirclesEqual, //Circle Circle intersection
15

16 17 18
                       NoIntersection, Tangent, Secant, // Circle Line Intersetion

                       Error // general
19 20 21
                       };

    void rotatePoint(QPointF &point, double alpha);
22
    void rotatePoint(QList<QPointF> &point, double alpha);
23
    void rotatePointDegree(QPointF &point, double alpha);
24
    void rotatePointDegree(QList<QPointF> &points, double alpha);
25
    IntersectType intersects(const Circle &circle1, const Circle &circle2);
26
    IntersectType intersects(const Circle &circle1, const Circle &circle2, QList<QPointF> &intersectionPoints);
27
    IntersectType intersects(const Circle &circle, const QLineF &line);
28
    IntersectType intersects(const Circle &circle, const QLineF &line, QList<QPointF> &intersectionPoints);
29
    double distance(const QPointF &p1, const QPointF p2);
30 31
    double angle(const QPointF &p1, const QPointF p2);
    double angleDegree(const QPointF &p1, const QPointF p2);
32 33 34 35
    double truncateAngle(double angle);
    double truncateAngleDegree(double angle);
}

36

37