diff options
| author | Paul Jungeblut <paul.jungeblut@gmail.com> | 2016-10-06 23:07:28 +0200 |
|---|---|---|
| committer | Paul Jungeblut <paul.jungeblut@gmail.com> | 2016-10-06 23:07:28 +0200 |
| commit | a097841ed4896a2564f941df90f50fde0d72417f (patch) | |
| tree | ff89b596fa0759ee59e19b2a3395b3616280b28a /geometry/lines.cpp | |
| parent | 3f894510900184c928749654938d2a917bd4ad27 (diff) | |
Typesetting for lines.
Diffstat (limited to 'geometry/lines.cpp')
| -rw-r--r-- | geometry/lines.cpp | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/geometry/lines.cpp b/geometry/lines.cpp index ec6fdde..2594ab4 100644 --- a/geometry/lines.cpp +++ b/geometry/lines.cpp @@ -1,11 +1,6 @@ -struct pt { //complex<double> does not work here, becuase we need to set pt.x and pt.y - double x, y; - pt() {}; - pt(double x, double y) : x(x), y(y) {}; -}; - +// Nicht complex<double> benutzen. Eigene struct schreiben. struct line { - double a, b, c; //a*x+b*y+c, b=0 <=> vertical line, b=1 <=> otherwise + double a, b, c; // ax + by + c = 0; vertikale Line: b = 0, sonst: b = 1 }; line pointsToLine(pt p1, pt p2) { @@ -34,4 +29,4 @@ bool areIntersect(line l1, line l2, pt &p) { if (fabs(l1.b) > EPSILON) p.y = -(l1.a * p.x + l1.c); else p.y = -(l2.a * p.x + l2.c); return true; -}
\ No newline at end of file +} |
