15,919,931 members
Home / Discussions / Visual Basic

Visual Basic

 Re: Object Required: WScript Anoop Brijmohun7-May-09 21:55 Anoop Brijmohun 7-May-09 21:55
 Re: Object Required: WScript Noctris8-May-09 0:09 Noctris 8-May-09 0:09
 Re: Object Required: WScript Dave Kreskowiak8-May-09 0:41 Dave Kreskowiak 8-May-09 0:41
 Help - a Different sort of Triangle Value Calculation cyndy_northrup7-May-09 18:05 cyndy_northrup 7-May-09 18:05
 Re: Help - a Different sort of Triangle Value Calculation Dalek Dave7-May-09 21:25 Dalek Dave 7-May-09 21:25
 Re: Help - a Different sort of Triangle Value Calculation cyndy_northrup8-May-09 10:18 cyndy_northrup 8-May-09 10:18
 Re: Help - a Different sort of Triangle Value Calculation cyndy_northrup8-May-09 22:05 cyndy_northrup 8-May-09 22:05
 HELP - Hypotenuse and Angle B Error cyndy_northrup7-May-09 18:04 cyndy_northrup 7-May-09 18:04
 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! ( I'm using VB 4.0 and can't upgrade right now so I have to work within that limitation) 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....?
 Re: HELP - Hypotenuse and Angle B Error Dalek Dave7-May-09 21:19 Dalek Dave 7-May-09 21:19
 Re: HELP - Hypotenuse and Angle B Error cyndy_northrup8-May-09 10:11 cyndy_northrup 8-May-09 10:11
 Re: HELP - Hypotenuse and Angle B Error Dave Kreskowiak8-May-09 0:35 Dave Kreskowiak 8-May-09 0:35
 Combo displaying font Ric70247-May-09 11:15 Ric7024 7-May-09 11:15
 Re: Combo displaying font Dave Kreskowiak7-May-09 14:30 Dave Kreskowiak 7-May-09 14:30
 Re: Combo displaying font DidiKunz8-May-09 1:31 DidiKunz 8-May-09 1:31
 Using print spooler to update shared log file Roy Barkas7-May-09 11:15 Roy Barkas 7-May-09 11:15
 Re: Using print spooler to update shared log file Dave Kreskowiak7-May-09 14:28 Dave Kreskowiak 7-May-09 14:28
 Re: Using print spooler to update shared log file Roy Barkas7-May-09 21:48 Roy Barkas 7-May-09 21:48
 Re: Using print spooler to update shared log file Dave Kreskowiak8-May-09 0:31 Dave Kreskowiak 8-May-09 0:31
 datatype conversion problem when fetching fromn database Ankit Aneja7-May-09 7:42 Ankit Aneja 7-May-09 7:42
 Re: datatype conversion problem when fetching fromn database Dave Kreskowiak7-May-09 10:00 Dave Kreskowiak 7-May-09 10:00
 Re: datatype conversion problem when fetching fromn database Ankit Aneja7-May-09 11:02 Ankit Aneja 7-May-09 11:02
 RAS option RASEO_RequireDataEncryption not work xmen3317-May-09 5:33 xmen331 7-May-09 5:33
 Re: RAS option RASEO_RequireDataEncryption not work Dave Kreskowiak7-May-09 6:03 Dave Kreskowiak 7-May-09 6:03
 Open all files in a Folder vijay24827-May-09 5:05 vijay2482 7-May-09 5:05
 Re: Open all files in a Folder Dave Kreskowiak7-May-09 5:32 Dave Kreskowiak 7-May-09 5:32
 Last Visit: 31-Dec-99 18:00     Last Update: 19-Jun-24 7:16 Refresh ᐊ Prev1...1113111411151116111711181119112011211122 Next ᐅ