summaryrefslogtreecommitdiff
path: root/geometry/triangle.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'geometry/triangle.cpp')
-rw-r--r--geometry/triangle.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/geometry/triangle.cpp b/geometry/triangle.cpp
index 4dbd532..a00eb56 100644
--- a/geometry/triangle.cpp
+++ b/geometry/triangle.cpp
@@ -12,6 +12,12 @@ double area(double a, double b, double c) {
return sqrt(s * (s-a) * (s-b) * (s-c));
}
+// Zentrum des größten Kreises im Dreiecke
+pt inCenter(pt a, pt b, pt c) {
+ double x = abs(a-b), y = abs(b-c), z = abs(a-c);
+ return (y*a + z*b + x*c) / (x+y+z);
+}
+
// Zentrum des Kreises durch alle Eckpunkte
pt outCenter(pt a, pt b, pt c) {
double d = 2.0 * (real(a) * imag(b-c) +
@@ -22,13 +28,6 @@ pt outCenter(pt a, pt b, pt c) {
c*conj(c)*conj(a-b)) / d;
}
-// Zentrum des größten Kreises im Dreiecke
-pt inCenter(pt a, pt b, pt c) {
- double x = abs(a-b), y = abs(b-c), z = abs(a-c);
- return (y*a + z*b + x*c) / (x+y+z);
-}
-
-
// Sind die Dreiecke a1, b1, c1, and a2, b2, c2 ähnlich?
// Erste Zeile testet Ähnlichkeit mit gleicher Orientierung,
// zweite Zeile testet Ähnlichkeit mit verschiedener Orientierung