diff options
Diffstat (limited to 'content/geometry/lines.cpp')
| -rw-r--r-- | content/geometry/lines.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/content/geometry/lines.cpp b/content/geometry/lines.cpp index 36de1db..0267faa 100644 --- a/content/geometry/lines.cpp +++ b/content/geometry/lines.cpp @@ -8,9 +8,9 @@ line pointsToLine(pt p1, pt p2) { // vertikale Gerade: b = 1 oder b = 0 if (abs(real(p1 - p2)) < EPS) { l.a = 1; l.b = 0.0; l.c = -real(p1); } else { - l.a = -imag(p1 - p2) / real(p1 - p2); + l.a = imag(p2 - p1) / real(p1 - p2); l.b = 1.0; - l.c = -(l.a * real(p1)) - imag(p1); + l.c = -l.a * real(p1) - imag(p1); } return l; } |
