summaryrefslogtreecommitdiff
path: root/content/geometry/lines.cpp
diff options
context:
space:
mode:
authorGloria Mundi <gloria@gloria-mundi.eu>2025-07-08 16:59:03 +0200
committerGloria Mundi <gloria@gloria-mundi.eu>2025-07-08 16:59:03 +0200
commite1c5a6c9b3737c75eaac7ec5d71673d74a1ac117 (patch)
tree579134667325002b1e0cd99f079e49ccc46cb022 /content/geometry/lines.cpp
parentab40e44682b10ac6f99827f764d4c90d93d66722 (diff)
parent65d957702f1e1d5fd202538fcf9ed6825eb45bb8 (diff)
merge mzuenni
Diffstat (limited to 'content/geometry/lines.cpp')
-rw-r--r--content/geometry/lines.cpp4
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;
}