summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMZuenni <michi.zuendorf@gmail.com>2025-06-26 20:57:51 +0200
committerMZuenni <michi.zuendorf@gmail.com>2025-06-26 20:57:51 +0200
commit65d957702f1e1d5fd202538fcf9ed6825eb45bb8 (patch)
tree466cda2de9dd6756258e0a987ce7f044e4c259e8
parent4335aa75cf7eb9a3bb6c64f7955a96a7dcc08c75 (diff)
shorten code
-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;
}