|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Analyse der Dreiecksart |
|
|
// Analyse der Dreiecksart |
|
|
public static TriangleType checkTriangle(float a, float b, float c) { |
|
|
public static TriangleType checkTriangle(float a, float b, float c) { |
|
|
if (a + b > c || b + c > a || a + c > b) { |
|
|
|
|
|
|
|
|
if (a + b > c && b + c > a && a + c > b) { |
|
|
|
|
|
if ( a == b && b == c) { |
|
|
|
|
|
System.out.println("Gleichseitiges Dreieck"); |
|
|
|
|
|
return TriangleType.EQUILATERAL; |
|
|
|
|
|
} |
|
|
|
|
|
if ( a == b || b == c || a == c) { |
|
|
|
|
|
System.out.println("Gleichschenkliges Dreieck"); |
|
|
|
|
|
return TriangleType.ISOSCELES; |
|
|
|
|
|
} |
|
|
|
|
|
System.out.println("Dreieck"); |
|
|
return TriangleType.NORMAL; |
|
|
return TriangleType.NORMAL; |
|
|
} |
|
|
} |
|
|
|
|
|
System.out.println("Kein Dreieck"); |
|
|
return TriangleType.NONE; |
|
|
return TriangleType.NONE; |
|
|
} |
|
|
} |
|
|
|
|
|
|