I am writing a simple triangle calculation of sides and angles program, and the final thing that the professor wants is the type and the class of the triangle. I have written two functions that are prototyped here:
double calcSide( double s1, double s2, double ang3 );
double calcAngle( double s1, double s2, double ang1 );
The precision problem in the directions is the only thing messing me up. I am not sure what the question is asking. Can someone let me know what he is saying by this? These are the instructions for how the functions should work:
a) The Triangle Type analysis will result in "Acute" if all the angles are less than 90o, "Obtuse" if one of the angles is greater than 90o, and "Right" if one angle is equal to 90o. Note that since you will be using floating point values with imprecision, you should test the angles to see if they are within 0.1 of each other since you cannot accurately test for equality.
b) The Triangle Class analysis will result in "Equilateral" if all the sides are equal, "Isoscoles" if two sides are equal, and "Scalene" if no sides are equal. Again, remember to test for the sides being within 0.1 so that precision issues are mitigated.