Here's what I have so far. I'm including the getThirdSide() method just for completeness, it is working fine though.

public double getThirdSide() { if (!(isValid())) return 0; double radianAngle = angle * Math.PI / 180; double lawOfCos = 0; double cosAngle = Math.cos(radianAngle); lawOfCos = (side1 * side1) + (side2 * side2) - 2 * side1 * side2 * cosAngle; double thirdSide = Math.sqrt(lawOfCos); return thirdSide; } public boolean isRight() { double side3 = this.getThirdSide(); // This converts the angle from degrees to radians double radianAngle = angle * Math.PI / 180; // This uses the law of sines to compute the second angle double sinB = (Math.sin(radianAngle) * side1) / side3; // 1/sin(sinB) to equal csc(sinB) which is the inverse of sin double angleB = 1 / Math.sin(sinB); // Converts the second angle back to degrees angleB = angleB * 180 / Math.PI; double angleC = 180 - angle - angleB; // declared at beginning of program, final double TOLERANCE = 0.01 if (Math.abs(angle - 90) < TOLERANCE) return true; if (Math.abs(angleB - 90) < TOLERANCE) return true; if (Math.abs(angleC - 90) < TOLERANCE) return true; else return false; }

Like I said, the getThirdSide() method works great, but I can't get isRight() to return true for a known right triangle such as the triangle with side1 = 1, side2 = 2, and angle = 60. The third side is the square root of 3, and the two other angles are 30 and 90. I changed some code around to get isRight() to return a String so I could see what the angle values were and did not come up with 30 60 90, so I know there is a problem with the math. Any help would be greatly appreciated.