astrogirl77
Programmer
If you only know two side lengths of a scalene triangle (but none of the angles) can you determine the third side length?
I had been using this formula to determine the length of the hypotenuse ;
SQRT ( side1^2 + side2^2)
But realized that this is meant ONLY to determine the side length of the hypotenuse for right triangles and not scalenes per se.... is there some other formla that can be used to get the line length of the hypotenuse for a scalene in the above situation?
If there isn't a way to get the 3rd line length of scalenes this way, do you know if there is a way to get the hypotenuse line length AND the angle between the hypotenuse and the base, if we have the two side lengths of the base(adjacent) and the opposite side, and if we have the associated angles for these sides?
I've tried to incorporate all I've learned so far... but I keep getting weird errors and as far as I can tell all my formulas are correct?
I've built a small VB program, am including a sample below and the critical formulas and code I'm using... if any one can shed some light on where I've gone wrong it would be so nice!
Here is an example ;
Accept input from three text entry boxes
1.) Value for Side (a), Adjacent Base
the value of 14 is entered
2.) Value for Side (c), Opposite
the value of 10 is entered
3.) Angle (B) [ entered as degrees ]
the value of 60 degrees is entered
The hypotenuse is computed to be ;
8.83176086632785
The arc cos function is derived ;
Public Function Arccos(X As Double) As Double
Arccos = Atn(-X / Sqr(-X * X + 1)) + 2 * Atn(1)
End Function
Its then called from code below
Pi is declared as a constant in a module
'=======================
'=======================
'Converts the entry from degrees to radians
angle_B_degree_value_radians = (angle_B_degree_value * Pi) / 180
'get hypotenuse side length and outputs it to a text box
side_b_squared = CDbl(c1 ^ 2 + a1 ^ 2 - (c1 * a1)) * Cos(angle_B_degree_value_radians)
b1 = Sqr(side_b_squared)
Text5.Text = b1
angle_C_cos_value = CDbl(a1 ^ 2 + b1 ^ 2 - c1 ^ 2) / (2 * (a1 * b1))
angle_B_cos_value = CDbl(c1 ^ 2 + a1 ^ 2 - b1 ^ 2) / (2 * (c1 * a1))
angle_A_cos_value = CDbl(b1 ^ 2 + c1 ^ 2 - a1 ^ 2) / (2 * (b1 * c1))
angle_C_acos_value = (Arccos(angle_C_cos_value))
angle_B_acos_value = (Arccos(angle_B_cos_value))
angle_A_acos_value = (Arccos(angle_A_cos_value))
angle_C_degree_value = angle_C_acos_value * 180 / Pi
angle_B_degree_value = angle_B_acos_value * 180 / Pi
angle_A_degree_value = angle_A_acos_value * 180 / Pi
'=======================
'=======================
The problem is, that
angle_B_Degree Value 38.8700377933938
is returned as a degree value very different from what I entered ( 60 ) degrees! I wanted to recompute this angle to confirm that it was working ok.... but it seems often off, so now I dont know how valid any of my calculations are! I don't understand why this is happening?
I've also tried entering angles different from 60 degrees but with the samed side length values, for instance if I enter 90 degrees or 120 degrees it jus automatically fails.... if I enter 80 degrees I also get an error back....?