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

# Visual Basic

 Re: How to Create MySQL database and Restore in VB 6.0 Noctris8-May-09 0:08 Noctris 8-May-09 0:08
 Re: How to Create MySQL database and Restore in VB 6.0 Dalek Dave8-May-09 1:13 Dalek Dave 8-May-09 1:13
 Object Required: WScript Anoop Brijmohun7-May-09 21:03 Anoop Brijmohun 7-May-09 21:03
 Re: Object Required: WScript Mycroft Holmes7-May-09 21:41 Mycroft Holmes 7-May-09 21:41
 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
 I'm looking for some help with computing values of a triangle and then drawing it to screen Known; Two points in degrees exist on a circle Two line lengths representing ; base, adjacent side (a) and opposite (c) we want to derive side (b) hypotenuse and also angles (A), (B), (C) We already know that sides (a) and (c) join and we know that the longest side length will not exceed the diameter of the circle that the triangle is circumscribed within The triangle created will be variable as different degrees and side lengths are entered, typically this will be scalene triangles but the may also be at times right triangles I've been using a derived arc cos function ; ------------------------------------------------------------------------ Public Function Arccos(X As Double) As Double Arccos = Atn(-X / Sqr(-X * X + 1)) + 2 * Atn(1) End Function ------------------------------------------------------------------------ I know we can convert degrees to radians via "* Pi) / 180" I know I can get the hypotenuse by; ------------------------------------------------------------------------ side_b_squared = CDbl(c1 ^ 2 + a1 ^ 2 - (c1 * a1)) * Cos(angle_B_degree_value_radians) b1 = Sqr(side_b_squared) ------------------------------------------------------------------------ I know we can get the angles A,B,C via ; ------------------------------------------------------------------------ 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 ------------------------------------------------------------------------ Although, I've had some trouble with this since some of the returned angles for some previous testing I did didn't seem to be working very well, for instance I'd enter 60 degrees for angle (B) but it would somehow crunch it to angle_B_Degree Value 38.8700377933938 I'm a little stuck on the math for all this.... here is an example scenario that I hope illustrates really clearly what I'm trying to do ; A small VB app does the following ; A small circle is drawn to the screen On the form of the VB app there are text boxes that accept inputs ; Text 1 = side (c) length as a number Text 2 = side (a) length as a number Text 3 = a value in degrees that represents a point of one of the ends of side (c) Text 4 = a value in degrees that represents a point of one of the ends of side (a) Then the following are computed ; side length of the hypotenuse as a number, and output to a different text box Angles (A), (B), (C) are computed as values in degrees, and output to another text box The drawn circle may be say four inches in diameter, and all side lengths computed, regardless of their number value are fit proprotionally, circumscribed within the circle, so even if one of the side lengths is really long, all side lengths are fit proportionally in the circle but retaining the same intrinsic unit measure values of their lengths. Any help or insights on the above are really appreciated, especially the math and formula end and any code ideas, samples are a God send. I'm a bit of a newbie with all this and I'm using an older version of VB (4.0) I have a basic idea on using some of the draw functions and I think I can tinker my way through this, but again am very open to any feedback Thanks people!
 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
 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
 Last Visit: 31-Dec-99 18:00     Last Update: 18-Jun-24 11:22 Refresh ᐊ Prev1...1113111411151116111711181119112011211122 Next ᐅ