kig
common.cpp
Go to the documentation of this file.
97 double left = (xa == xb) ? -std::numeric_limits<double>::infinity() :(r.left()-xa)*(yb-ya)/(xb-xa)+ya;
98 double right = (xa == xb) ? std::numeric_limits<double>::infinity() :(r.right()-xa)*(yb-ya)/(xb-xa)+ya;
99 double top = (ya == yb) ? std::numeric_limits<double>::infinity() : (r.top()-ya)*(xb-xa)/(yb-ya)+xa;
100 double bottom = (ya == yb) ? -std::numeric_limits<double>::infinity() : (r.bottom()-ya)*(xb-xa)/(yb-ya)+xa;
void calcRayBorderPoints(const Coordinate &a, Coordinate &b, const Rect &r)
this does the same as the above function, but only for b.
Definition: common.cpp:131
double calcDistancePointLine(const Coordinate &p, const LineData &l)
calc the distance of point p to the line through a and b...
Definition: common.cpp:302
bool isOnLine(const Coordinate &o, const Coordinate &a, const Coordinate &b, const double fault)
is o on the line defined by point a and point b ? fault is the allowed difference...
Definition: common.cpp:188
bool isOrthogonalTo(const LineData &l) const
Return true if this line is orthogonal to l.
Definition: common.cpp:474
bool areCollinear(const Coordinate &p1, const Coordinate &p2, const Coordinate &p3)
test collinearity of three points
Definition: common.cpp:489
double toDouble(bool *ok) const
Coordinate calcPointOnPerpend(const LineData &l, const Coordinate &t)
This file is part of Kig, a KDE program for Interactive Geometry...
Definition: common.cpp:37
The Coordinate class is the basic class representing a 2D location by its x and y components...
Definition: coordinate.h:33
bool isSingular(const double &a, const double &b, const double &c, const double &d)
test if a 2x2 matrix is singular (relatively to the norm of the two row vectors)
Definition: common.cpp:495
const ScreenInfo & screenInfo() const
the part of the document we're currently showing i.e.
Definition: kig_view.cpp:272
bool isOnSegment(const Coordinate &o, const Coordinate &a, const Coordinate &b, const double fault)
is o on the segment defined by point a and point b ? this calls isOnLine(), but also checks if o is "...
Definition: common.cpp:212
double getDoubleFromUser(const QString &caption, const QString &label, double value, QWidget *parent, bool *ok, double min, double max, int decimals)
Here, we define some algorithms which we need in various places...
Definition: common.cpp:349
Coordinate calcCircleRadicalStartPoint(const Coordinate &ca, const Coordinate &cb, double sqra, double sqrb)
Definition: common.cpp:335
const Coordinate calcArcLineIntersect(const Coordinate &c, const double sqr, const double sa, const double angle, const LineData &l, int side)
this calcs the intersection points of the arc with center c, radius sqrt( r ), start angle sa and ang...
Definition: common.cpp:285
Coordinate calcRotatedPoint(const Coordinate &a, const Coordinate &c, const double arc)
This calcs the rotation of point a around point c by arc arc.
Definition: common.cpp:315
const Coordinate calcMirrorPoint(const LineData &l, const Coordinate &p)
calc the mirror point of p over the line l
Definition: common.cpp:250
Coordinate calcIntersectionPoint(const LineData &l1, const LineData &l2)
this calcs the point where the lines l and m intersect...
Definition: common.cpp:57
bool isOnRay(const Coordinate &o, const Coordinate &a, const Coordinate &b, const double fault)
Definition: common.cpp:226
bool isParallelTo(const LineData &l) const
Return true if this line is parallel to l.
Definition: common.cpp:459
bool lineInRect(const Rect &r, const Coordinate &a, const Coordinate &b, const int width, const ObjectImp *imp, const KigWidget &w)
Is the line, segment, ray or vector inside r ? We need the imp to distinguish between rays...
Definition: common.cpp:401
const Coordinate calcCenter(const Coordinate &a, const Coordinate &b, const Coordinate &c)
This function calculates the center of the circle going through the three given points.
Definition: common.cpp:366
void calcBorderPoints(Coordinate &p1, Coordinate &p2, const Rect &r)
this sets p1 and p2 to p1' and p2' so that p1'p2' is the same line as p1p2, and so that p1' and p2' a...
Definition: common.cpp:82
Coordinate calcPointOnParallel(const LineData &l, const Coordinate &t)
this returns a point, so that the line through point t and the point returned is parallel with the li...
Definition: common.cpp:47
bool isOnArc(const Coordinate &o, const Coordinate &c, const double r, const double sa, const double a, const double fault)
Definition: common.cpp:238
virtual bool contains(const Coordinate &p, int width, const KigWidget &si) const =0
The ObjectImp class represents the behaviour of an object after it is calculated. ...
Definition: object_imp.h:226
const Coordinate calcCircleLineIntersect(const Coordinate &c, const double sqr, const LineData &l, int side)
this calcs the intersection points of the circle with center c and radius sqrt( r )...
Definition: common.cpp:262
const Coordinate calcPointProjection(const Coordinate &p, const LineData &l)
this calculates the perpendicular projection of point p on line ab...
Definition: common.cpp:295
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:12:05 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:12:05 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.