• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdeedu API Reference
  • KDE Home
  • Contact Us
 

kig

  • sources
  • kde-4.12
  • kdeedu
  • kig
  • misc
common.cpp
Go to the documentation of this file.
1 
21 #include "common.h"
22 
23 #include <math.h>
24 
25 #include "../kig/kig_view.h"
26 #include "../objects/object_imp.h"
27 
28 #include <cmath>
29 #include <limits>
30 
31 #include <kdebug.h>
32 #include <knumvalidator.h>
33 #include <klocale.h>
34 #include <kglobal.h>
35 #include <kinputdialog.h>
36 
37 Coordinate calcPointOnPerpend( const LineData& l, const Coordinate& t )
38 {
39  return calcPointOnPerpend( l.b - l.a, t );
40 }
41 
42 Coordinate calcPointOnPerpend( const Coordinate& dir, const Coordinate& t )
43 {
44  return t + ( dir ).orthogonal();
45 }
46 
47 Coordinate calcPointOnParallel( const LineData& l, const Coordinate& t )
48 {
49  return calcPointOnParallel( l.b - l.a, t );
50 }
51 
52 Coordinate calcPointOnParallel( const Coordinate& dir, const Coordinate& t )
53 {
54  return t + dir*5;
55 }
56 
57 Coordinate calcIntersectionPoint( const LineData& l1, const LineData& l2 )
58 {
59  const Coordinate& pa = l1.a;
60  const Coordinate& pb = l1.b;
61  const Coordinate& pc = l2.a;
62  const Coordinate& pd = l2.b;
63 
64  double
65  xab = pb.x - pa.x,
66  xdc = pd.x - pc.x,
67  xac = pc.x - pa.x,
68  yab = pb.y - pa.y,
69  ydc = pd.y - pc.y,
70  yac = pc.y - pa.y;
71 
72  double det = xab*ydc - xdc*yab;
73  double detn = xac*ydc - xdc*yac;
74 
75  // test for parallelism
76  if ( fabs (det) < 1e-6 ) return Coordinate::invalidCoord();
77  double t = detn/det;
78 
79  return pa + t*(pb - pa);
80 }
81 
82 void calcBorderPoints( Coordinate& p1, Coordinate& p2, const Rect& r )
83 {
84  calcBorderPoints( p1.x, p1.y, p2.x, p2.y, r );
85 }
86 
87 const LineData calcBorderPoints( const LineData& l, const Rect& r )
88 {
89  LineData ret( l );
90  calcBorderPoints( ret.a.x, ret.a.y, ret.b.x, ret.b.y, r );
91  return ret;
92 }
93 
94 void calcBorderPoints( double& xa, double& ya, double& xb, double& yb, const Rect& r )
95 {
96  // we calc where the line through a(xa,ya) and b(xb,yb) intersects with r:
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;
101 
102  // now we go looking for valid points
103  int novp = 0; // number of valid points we have already found
104 
105  if (!(top < r.left() || top > r.right())) {
106  // the line intersects with the top side of the rect.
107  ++novp;
108  xa = top; ya = r.top();
109  };
110  if (!(left < r.bottom() || left > r.top())) {
111  // the line intersects with the left side of the rect.
112  if (novp++) { xb = r.left(); yb=left; }
113  else { xa = r.left(); ya=left; };
114  };
115  if (!(right < r.bottom() || right > r.top())) {
116  // the line intersects with the right side of the rect.
117  if (novp++) { xb = r.right(); yb=right; }
118  else { xa = r.right(); ya=right; };
119  };
120  if (!(bottom < r.left() || bottom > r.right())) {
121  // the line intersects with the bottom side of the rect.
122  ++novp;
123  xb = bottom; yb = r.bottom();
124  };
125  if (novp < 2) {
126  // line is completely outside of the window...
127  xa = ya = xb = yb = 0;
128  };
129 }
130 
131 void calcRayBorderPoints( const Coordinate& a, Coordinate& b, const Rect& r )
132 {
133  calcRayBorderPoints( a.x, a.y, b.x, b.y, r );
134 }
135 
136 void calcRayBorderPoints( const double xa, const double ya, double& xb,
137  double& yb, const Rect& r )
138 {
139  // we calc where the line through a(xa,ya) and b(xb,yb) intersects with r:
140  double left = (r.left()-xa)*(yb-ya)/(xb-xa)+ya;
141  double right = (r.right()-xa)*(yb-ya)/(xb-xa)+ya;
142  double top = (r.top()-ya)*(xb-xa)/(yb-ya)+xa;
143  double bottom = (r.bottom()-ya)*(xb-xa)/(yb-ya)+xa;
144 
145  // now we see which we can use...
146  if(
147  // the ray intersects with the top side of the rect..
148  top >= r.left() && top <= r.right()
149  // and b is above a
150  && yb > ya )
151  {
152  xb = top;
153  yb = r.top();
154  return;
155  };
156  if(
157  // the ray intersects with the left side of the rect...
158  left >= r.bottom() && left <= r.top()
159  // and b is on the left of a..
160  && xb < xa )
161  {
162  xb = r.left();
163  yb=left;
164  return;
165  };
166  if (
167  // the ray intersects with the right side of the rect...
168  right >= r.bottom() && right <= r.top()
169  // and b is to the right of a..
170  && xb > xa )
171  {
172  xb = r.right();
173  yb=right;
174  return;
175  };
176  if(
177  // the ray intersects with the bottom side of the rect...
178  bottom >= r.left() && bottom <= r.right()
179  // and b is under a..
180  && yb < ya ) {
181  xb = bottom;
182  yb = r.bottom();
183  return;
184  };
185  kError() << "damn" << endl;
186 }
187 
188 bool isOnLine( const Coordinate& o, const Coordinate& a,
189  const Coordinate& b, const double fault )
190 {
191  double x1 = a.x;
192  double y1 = a.y;
193  double x2 = b.x;
194  double y2 = b.y;
195 
196  // check your math theory ( homogeneous coordinates ) for this
197  double tmp = fabs( o.x * (y1-y2) + o.y*(x2-x1) + (x1*y2-y1*x2) );
198  return tmp < ( fault * (b-a).length());
199  // if o is on the line ( if the determinant of the matrix
200  // |---|---|---|
201  // | x | y | z |
202  // |---|---|---|
203  // | x1| y1| z1|
204  // |---|---|---|
205  // | x2| y2| z2|
206  // |---|---|---|
207  // equals 0, then p(x,y,z) is on the line containing points
208  // p1(x1,y1,z1) and p2 here, we're working with normal coords, no
209  // homogeneous ones, so all z's equal 1
210 }
211 
212 bool isOnSegment( const Coordinate& o, const Coordinate& a,
213  const Coordinate& b, const double fault )
214 {
215  return isOnLine( o, a, b, fault )
216  // not too far to the right
217  && (o.x - kigMax(a.x,b.x) < fault )
218  // not too far to the left
219  && ( kigMin (a.x, b.x) - o.x < fault )
220  // not too high
221  && ( kigMin (a.y, b.y) - o.y < fault )
222  // not too low
223  && ( o.y - kigMax (a.y, b.y) < fault );
224 }
225 
226 bool isOnRay( const Coordinate& o, const Coordinate& a,
227  const Coordinate& b, const double fault )
228 {
229  return isOnLine( o, a, b, fault )
230  // not too far in front of a horizontally..
231 // && ( a.x - b.x < fault ) == ( a.x - o.x < fault )
232  && ( ( a.x < b.x ) ? ( a.x - o.x < fault ) : ( a.x - o.x > -fault ) )
233  // not too far in front of a vertically..
234 // && ( a.y - b.y < fault ) == ( a.y - o.y < fault );
235  && ( ( a.y < b.y ) ? ( a.y - o.y < fault ) : ( a.y - o.y > -fault ) );
236 }
237 
238 bool isOnArc( const Coordinate& o, const Coordinate& c, const double r,
239  const double sa, const double a, const double fault )
240 {
241  if ( fabs( ( c - o ).length() - r ) > fault )
242  return false;
243  Coordinate d = o - c;
244  double angle = atan2( d.y, d.x );
245 
246  if ( angle < sa ) angle += 2 * M_PI;
247  return angle - sa - a < 1e-4;
248 }
249 
250 const Coordinate calcMirrorPoint( const LineData& l,
251  const Coordinate& p )
252 {
253  Coordinate m =
254  calcIntersectionPoint( l,
255  LineData( p,
256  calcPointOnPerpend( l, p )
257  )
258  );
259  return 2*m - p;
260 }
261 
262 const Coordinate calcCircleLineIntersect( const Coordinate& c,
263  const double sqr,
264  const LineData& l,
265  int side )
266 {
267  Coordinate proj = calcPointProjection( c, l );
268  Coordinate hvec = proj - c;
269  Coordinate lvec = -l.dir();
270 
271  double sqdist = hvec.squareLength();
272  double sql = sqr - sqdist;
273  if ( sql < 0.0 )
274  return Coordinate::invalidCoord();
275  else
276  {
277  double l = sqrt( sql );
278  lvec = lvec.normalize( l );
279  lvec *= side;
280 
281  return proj + lvec;
282  };
283 }
284 
285 const Coordinate calcArcLineIntersect( const Coordinate& c, const double sqr,
286  const double sa, const double angle,
287  const LineData& l, int side )
288 {
289  const Coordinate possiblepoint = calcCircleLineIntersect( c, sqr, l, side );
290  if ( isOnArc( possiblepoint, c, sqrt( sqr ), sa, angle, test_threshold ) )
291  return possiblepoint;
292  else return Coordinate::invalidCoord();
293 }
294 
295 const Coordinate calcPointProjection( const Coordinate& p,
296  const LineData& l )
297 {
298  Coordinate orth = l.dir().orthogonal();
299  return p + orth.normalize( calcDistancePointLine( p, l ) );
300 }
301 
302 double calcDistancePointLine( const Coordinate& p,
303  const LineData& l )
304 {
305  double xa = l.a.x;
306  double ya = l.a.y;
307  double xb = l.b.x;
308  double yb = l.b.y;
309  double x = p.x;
310  double y = p.y;
311  double norm = l.dir().length();
312  return ( yb * x - ya * x - xb * y + xa * y + xb * ya - yb * xa ) / norm;
313 }
314 
315 Coordinate calcRotatedPoint( const Coordinate& a, const Coordinate& c, const double arc )
316 {
317  // we take a point p on a line through c and parallel with the
318  // X-axis..
319  Coordinate p( c.x + 5, c.y );
320  // we then calc the arc that ac forms with cp...
321  Coordinate d = a - c;
322  d = d.normalize();
323  double aarc = std::acos( d.x );
324  if ( d.y < 0 ) aarc = 2*M_PI - aarc;
325 
326  // we now take the sum of the two arcs to find the arc between
327  // pc and ca
328  double asum = aarc + arc;
329 
330  Coordinate ret( std::cos( asum ), std::sin( asum ) );
331  ret = ret.normalize( ( a -c ).length() );
332  return ret + c;
333 }
334 
335 Coordinate calcCircleRadicalStartPoint( const Coordinate& ca, const Coordinate& cb,
336  double sqra, double sqrb )
337 {
338  Coordinate direc = cb - ca;
339  Coordinate m = (ca + cb)/2;
340 
341  double dsq = direc.squareLength();
342  double lambda = dsq == 0.0 ? 0.0
343  : (sqra - sqrb) / (2*dsq);
344 
345  direc *= lambda;
346  return m + direc;
347 }
348 
349 double getDoubleFromUser( const QString& caption, const QString& label, double value,
350  QWidget* parent, bool* ok, double min, double max, int decimals )
351 {
352  KDoubleValidator vtor( min, max, decimals,0 );
353 
354  QString input = KInputDialog::getText(
355  caption, label, KGlobal::locale()->formatNumber( value, decimals ),
356  ok, parent, &vtor );
357 
358  bool myok = true;
359  double ret = KGlobal::locale()->readNumber( input, &myok );
360  if ( ! myok )
361  ret = input.toDouble( & myok );
362  if ( ok ) *ok = myok;
363  return ret;
364 }
365 
366 const Coordinate calcCenter(
367  const Coordinate& a, const Coordinate& b, const Coordinate& c )
368 {
369  // this algorithm is written by my brother, Christophe Devriese
370  // <oelewapperke@ulyssis.org> ...
371  // I don't get it myself :)
372 
373  double xdo = b.x-a.x;
374  double ydo = b.y-a.y;
375 
376  double xao = c.x-a.x;
377  double yao = c.y-a.y;
378 
379  double a2 = xdo*xdo + ydo*ydo;
380  double b2 = xao*xao + yao*yao;
381 
382  double numerator = (xdo * yao - xao * ydo);
383  if ( numerator == 0 )
384  {
385  // problem: xdo * yao == xao * ydo <=> xdo/ydo == xao / yao
386  // this means that the lines ac and ab have the same direction,
387  // which means they're the same line..
388  // FIXME: i would normally throw an error here, but KDE doesn't
389  // use exceptions, so I'm returning a bogus point :(
390  return a.invalidCoord();
391  /* return (a+c)/2; */
392  };
393  double denominator = 0.5 / numerator;
394 
395  double centerx = a.x - (ydo * b2 - yao * a2) * denominator;
396  double centery = a.y + (xdo * b2 - xao * a2) * denominator;
397 
398  return Coordinate(centerx, centery);
399 }
400 
401 bool lineInRect( const Rect& r, const Coordinate& a, const Coordinate& b,
402  const int width, const ObjectImp* imp, const KigWidget& w )
403 {
404  double miss = w.screenInfo().normalMiss( width );
405 
406 //mp: the following test didn't work for vertical segments;
407 // fortunately the ieee floating point standard allows us to avoid
408 // the test altogether, since it would produce an infinity value that
409 // makes the final r.contains to fail
410 // in any case the corresponding test for a.y - b.y was missing.
411 
412 // if ( fabs( a.x - b.x ) <= 1e-7 )
413 // {
414 // // too small to be useful..
415 // return r.contains( Coordinate( a.x, r.center().y ), miss );
416 // }
417 
418 // in case we have a segment we need also to check for the case when
419 // the segment is entirely contained in the rect, in which case the
420 // final tests all fail.
421 // it is ok to just check for the midpoint in the rect since:
422 // - if we have a segment completely contained in the rect this is true
423 // - if the midpoint is in the rect than returning true is safe (also
424 // in the cases where we have a ray or a line)
425 
426  if ( r.contains( 0.5*( a + b ), miss ) ) return true;
427 
428  Coordinate dir = b - a;
429  double m = dir.y / dir.x;
430  double lefty = a.y + m * ( r.left() - a.x );
431  double righty = a.y + m * ( r.right() - a.x );
432  double minv = dir.x / dir.y;
433  double bottomx = a.x + minv * ( r.bottom() - a.y );
434  double topx = a.x + minv * ( r.top() - a.y );
435 
436  // these are the intersections between the line, and the lines
437  // defined by the sides of the rectangle.
438  Coordinate leftint( r.left(), lefty );
439  Coordinate rightint( r.right(), righty );
440  Coordinate bottomint( bottomx, r.bottom() );
441  Coordinate topint( topx, r.top() );
442 
443  // For each intersection, we now check if we contain the
444  // intersection ( this might not be the case for a segment, when the
445  // intersection is not between the begin and end point.. ) and if
446  // the rect contains the intersection.. If it does, we have a winner..
447  return
448  ( imp->contains( leftint, width, w ) && r.contains( leftint, miss ) ) ||
449  ( imp->contains( rightint, width, w ) && r.contains( rightint, miss ) ) ||
450  ( imp->contains( bottomint, width, w ) && r.contains( bottomint, miss ) ) ||
451  ( imp->contains( topint, width, w ) && r.contains( topint, miss ) );
452 }
453 
454 bool operator==( const LineData& l, const LineData& r )
455 {
456  return l.a == r.a && l.b == r.b;
457 }
458 
459 bool LineData::isParallelTo( const LineData& l ) const
460 {
461  const Coordinate& p1 = a;
462  const Coordinate& p2 = b;
463  const Coordinate& p3 = l.a;
464  const Coordinate& p4 = l.b;
465 
466  double dx1 = p2.x - p1.x;
467  double dy1 = p2.y - p1.y;
468  double dx2 = p4.x - p3.x;
469  double dy2 = p4.y - p3.y;
470 
471  return isSingular( dx1, dy1, dx2, dy2 );
472 }
473 
474 bool LineData::isOrthogonalTo( const LineData& l ) const
475 {
476  const Coordinate& p1 = a;
477  const Coordinate& p2 = b;
478  const Coordinate& p3 = l.a;
479  const Coordinate& p4 = l.b;
480 
481  double dx1 = p2.x - p1.x;
482  double dy1 = p2.y - p1.y;
483  double dx2 = p4.x - p3.x;
484  double dy2 = p4.y - p3.y;
485 
486  return isSingular( dx1, dy1, -dy2, dx2 );
487 }
488 
489 bool areCollinear( const Coordinate& p1,
490  const Coordinate& p2, const Coordinate& p3 )
491 {
492  return isSingular( p2.x - p1.x, p2.y - p1.y, p3.x - p1.x, p3.y - p1.y );
493 }
494 
495 bool isSingular( const double& a, const double& b,
496  const double& c, const double& d )
497 {
498  double det = a*d - b*c;
499  double norm1 = std::fabs(a) + std::fabs(b);
500  double norm2 = std::fabs(c) + std::fabs(d);
501 
502 /*
503  * test must be done relative to the magnitude of the two
504  * row (or column) vectors!
505  */
506  return ( std::fabs(det) < test_threshold*norm1*norm2 );
507 }
508 
509 const double double_inf = HUGE_VAL;
510 const double test_threshold = 1e-6;
calcRayBorderPoints
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
calcDistancePointLine
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
isOnLine
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
LineData::isOrthogonalTo
bool isOrthogonalTo(const LineData &l) const
Return true if this line is orthogonal to l.
Definition: common.cpp:474
ScreenInfo::normalMiss
double normalMiss(int width) const
Definition: screeninfo.cc:88
LineData
Simple class representing a line.
Definition: misc/common.h:49
LineData::dir
const Coordinate dir() const
The direction of the line.
Definition: misc/common.h:72
LineData::b
Coordinate b
Another point on the line.
Definition: misc/common.h:68
Rect::left
double left() const
Definition: rect.cc:186
Rect
This file is part of Kig, a KDE program for Interactive Geometry...
Definition: rect.h:34
QWidget
areCollinear
bool areCollinear(const Coordinate &p1, const Coordinate &p2, const Coordinate &p3)
test collinearity of three points
Definition: common.cpp:489
operator==
bool operator==(const LineData &l, const LineData &r)
Equality.
Definition: common.cpp:454
Rect::right
double right() const
Definition: rect.cc:190
calcPointOnPerpend
Coordinate calcPointOnPerpend(const LineData &l, const Coordinate &t)
This file is part of Kig, a KDE program for Interactive Geometry...
Definition: common.cpp:37
Coordinate
The Coordinate class is the basic class representing a 2D location by its x and y components...
Definition: coordinate.h:33
Coordinate::length
double length() const
Length.
Definition: coordinate.cpp:144
isSingular
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
KigWidget::screenInfo
const ScreenInfo & screenInfo() const
the part of the document we're currently showing i.e.
Definition: kig_view.cpp:272
Coordinate::normalize
const Coordinate normalize(double length=1) const
Normalize.
Definition: coordinate.cpp:154
isOnSegment
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
test_threshold
const double test_threshold
Definition: common.cpp:510
Rect::contains
bool contains(const Coordinate &p) const
Definition: rect.cc:222
getDoubleFromUser
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
calcCircleRadicalStartPoint
Coordinate calcCircleRadicalStartPoint(const Coordinate &ca, const Coordinate &cb, double sqra, double sqrb)
Definition: common.cpp:335
kigMax
T kigMax(const T &a, const T &b)
Definition: misc/common.h:261
calcArcLineIntersect
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
calcRotatedPoint
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
Rect::bottom
double bottom() const
Definition: rect.cc:194
LineData::a
Coordinate a
One point on the line.
Definition: misc/common.h:64
KigWidget
This class is the real widget showing the document.
Definition: kig_view.h:50
calcMirrorPoint
const Coordinate calcMirrorPoint(const LineData &l, const Coordinate &p)
calc the mirror point of p over the line l
Definition: common.cpp:250
Rect::top
double top() const
Definition: rect.cc:199
calcIntersectionPoint
Coordinate calcIntersectionPoint(const LineData &l1, const LineData &l2)
this calcs the point where the lines l and m intersect...
Definition: common.cpp:57
isOnRay
bool isOnRay(const Coordinate &o, const Coordinate &a, const Coordinate &b, const double fault)
Definition: common.cpp:226
Coordinate::squareLength
double squareLength() const
Square length.
Definition: coordinate.h:163
LineData::isParallelTo
bool isParallelTo(const LineData &l) const
Return true if this line is parallel to l.
Definition: common.cpp:459
kigMin
T kigMin(const T &a, const T &b)
Definition: misc/common.h:255
common.h
lineInRect
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
calcCenter
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
Coordinate::invalidCoord
static Coordinate invalidCoord()
Create an invalid Coordinate.
Definition: coordinate.cpp:171
double_inf
const double double_inf
Definition: common.cpp:509
calcBorderPoints
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
calcPointOnParallel
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
isOnArc
bool isOnArc(const Coordinate &o, const Coordinate &c, const double r, const double sa, const double a, const double fault)
Definition: common.cpp:238
ObjectImp::contains
virtual bool contains(const Coordinate &p, int width, const KigWidget &si) const =0
Coordinate::x
double x
X Component.
Definition: coordinate.h:126
Coordinate::orthogonal
const Coordinate orthogonal() const
Orthogonal.
Definition: coordinate.cpp:149
Coordinate::y
double y
Y Component.
Definition: coordinate.h:129
ObjectImp
The ObjectImp class represents the behaviour of an object after it is calculated. ...
Definition: object_imp.h:226
calcCircleLineIntersect
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
calcPointProjection
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-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:35:39 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kig

Skip menu "kig"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members

kdeedu API Reference

Skip menu "kdeedu API Reference"
  • Analitza
  •     lib
  • kalgebra
  • kalzium
  •   libscience
  • kanagram
  • kig
  •   lib
  • klettres
  • kstars
  • libkdeedu
  •   keduvocdocument
  • marble
  • parley
  • rocs
  •   App
  •   RocsCore
  •   VisualEditor
  •   stepcore

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal