|
|
|
|
|
|
|
|
public static TriangleType checkTriangle(float a, float b, float c) { |
|
|
public static TriangleType checkTriangle(float a, float b, float c) { |
|
|
|
|
|
|
|
|
if(a >= (b+c) || c >= (b+a) || b >= (a+c) || a<=0 || b<=0 || c<=0){ |
|
|
if(a >= (b+c) || c >= (b+a) || b >= (a+c) || a<=0 || b<=0 || c<=0){ |
|
|
|
|
|
|
|
|
return TriangleType.NONE; |
|
|
return TriangleType.NONE; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if(a == b && b==c) { |
|
|
if(a == b && b==c) { |
|
|
return TriangleType.EQUILATERAL; |
|
|
return TriangleType.EQUILATERAL; |
|
|
} |
|
|
} |
|
|
|
|
|
if(a == b || a == c || b == c){ |
|
|
|
|
|
return TriangleType.ISOSCELES; |
|
|
|
|
|
} |
|
|
return TriangleType.NORMAL; |
|
|
return TriangleType.NORMAL; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
} |