|
|
|
|
|
|
|
|
// 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) { |
|
|
|
|
|
|
|
|
|
|
|
//Dreieck |
|
|
if( (a+b>c) && (c+b>a) && (a+c>b)) { |
|
|
if( (a+b>c) && (c+b>a) && (a+c>b)) { |
|
|
|
|
|
//Gleichschenkliges Dreieck |
|
|
if(a==b || b==c|| a==c) { |
|
|
if(a==b || b==c|| a==c) { |
|
|
|
|
|
//Gleichseitiges Dreieck |
|
|
if (a == b && b == c && a == c) return TriangleType.EQUILATERAL; |
|
|
if (a == b && b == c && a == c) return TriangleType.EQUILATERAL; |
|
|
return TriangleType.ISOSCELES; |
|
|
return TriangleType.ISOSCELES; |
|
|
} |
|
|
} |