<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Help needed with Triangle solution calculator in VB.NET in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/help-needed-with-triangle-solution-calculator-in-vb-net/m-p/3326947#M57269</link>
    <description>&lt;P&gt;hi steve&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;how do&amp;nbsp;you ensure&amp;nbsp;conditions a &amp;gt; b and a &amp;gt; c when user inputs?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;felix&lt;/P&gt;</description>
    <pubDate>Fri, 10 Feb 2012 14:12:06 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2012-02-10T14:12:06Z</dc:date>
    <item>
      <title>Help needed with Triangle solution calculator in VB.NET</title>
      <link>https://forums.autodesk.com/t5/net-forum/help-needed-with-triangle-solution-calculator-in-vb-net/m-p/3326923#M57268</link>
      <description>&lt;P&gt;Hi Guys,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am a beta tester for AutoCAD, but I have a problem I would like some help with. I am creating a calculator that solves the right angled triangle for my CAD students. I have programmed it in VB.NET, all you have to enter are two known quantities to get the other results. It all works ok apart from entering 'B+a' and 'C+a', with these two I am getting weird results. (see attached image)&lt;/P&gt;&lt;P&gt;&amp;nbsp;I am using the 3,4,5 triangle to test the software. Any help would be much appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Steve.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the code I have for the application:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Imports System.String&lt;BR /&gt;Imports System.Math&lt;BR /&gt;Public Class Form1&lt;BR /&gt;Dim angleA As Single = 90&lt;BR /&gt;Dim angleB As Single&lt;BR /&gt;Dim angleC As Single&lt;BR /&gt;Dim sidea As Single&lt;BR /&gt;Dim sideb As Single&lt;BR /&gt;Dim sidec As Single&lt;/P&gt;&lt;P&gt;Private Sub NumericUpDown1_ValueChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles NumericUpDown1.ValueChanged&lt;BR /&gt;Controls.Add(NumericUpDown1)&lt;/P&gt;&lt;P&gt;End Sub&lt;/P&gt;&lt;P&gt;Public Function isItNullString(ByVal value) As Boolean&lt;BR /&gt;If value = "" Then&lt;BR /&gt;Return True&lt;BR /&gt;Else&lt;BR /&gt;Return False&lt;BR /&gt;End If&lt;BR /&gt;End Function&lt;/P&gt;&lt;P&gt;Public Sub pythagoreanTheoremThings()&lt;/P&gt;&lt;P&gt;If sideb = 0 Then&lt;BR /&gt;sideb = Math.Sqrt((sidea * sidea) - (sidec * sidec))&lt;BR /&gt;TextBoxSideb.Text = sideb&lt;/P&gt;&lt;P&gt;ElseIf sidea = 0 Then&lt;BR /&gt;sidea = Math.Sqrt((sideb * sideb) + (sidec * sidec))&lt;BR /&gt;TextBoxSidea.Text = sidea&lt;/P&gt;&lt;P&gt;ElseIf sidec = 0 Then&lt;BR /&gt;sidec = Math.Sqrt((sidea * sidea) - (sideb * sideb))&lt;BR /&gt;TextBoxSidec.Text = sidec&lt;BR /&gt;End If&lt;/P&gt;&lt;P&gt;End Sub&lt;/P&gt;&lt;P&gt;Public Sub angleSums()&lt;/P&gt;&lt;P&gt;If angleC = 0 And angleB &amp;lt;&amp;gt; 0 Then&lt;BR /&gt;angleC = 180 - angleA - angleB&lt;BR /&gt;TextBoxAngleC.Text = angleC&lt;BR /&gt;End If&lt;/P&gt;&lt;P&gt;If angleB = 0 And angleC &amp;lt;&amp;gt; 0 Then&lt;BR /&gt;angleB = 180 - angleA - angleC&lt;BR /&gt;TextBoxAngleB.Text = angleB&lt;BR /&gt;End If&lt;BR /&gt;End Sub&lt;/P&gt;&lt;P&gt;Public Sub angleBasWorkingAngle()&lt;/P&gt;&lt;P&gt;'Angle B and side b known, find side a&lt;BR /&gt;If angleB &amp;lt;&amp;gt; 0 Then&lt;BR /&gt;sidea = sideb / Sin(degreesToRadians(angleB))&lt;BR /&gt;TextBoxSidea.Text = sidea&lt;BR /&gt;End If&lt;/P&gt;&lt;P&gt;'Angle B and side c known, find side b&lt;BR /&gt;If angleB &amp;lt;&amp;gt; 0 And sidec &amp;lt;&amp;gt; 0 Then&lt;BR /&gt;sideb = sidec * Tan(degreesToRadians(angleB))&lt;BR /&gt;TextBoxSideb.Text = sideb&lt;BR /&gt;End If&lt;/P&gt;&lt;P&gt;End Sub&lt;/P&gt;&lt;P&gt;Public Sub findangleC()&lt;/P&gt;&lt;P&gt;If angleC = 0 Then&lt;BR /&gt;'cos&lt;BR /&gt;angleC = radiansToDegrees(Acos(sideb / sidea))&lt;BR /&gt;TextBoxAngleC.Text = angleC&lt;BR /&gt;End If&lt;/P&gt;&lt;P&gt;End Sub&lt;/P&gt;&lt;P&gt;Public Sub feedValues()&lt;/P&gt;&lt;P&gt;If Not isItNullString(TextBoxSideb.Text) Then&lt;BR /&gt;sideb = TextBoxSideb.Text&lt;BR /&gt;Else&lt;BR /&gt;sideb = 0&lt;BR /&gt;End If&lt;/P&gt;&lt;P&gt;If Not isItNullString(TextBoxSidea.Text) Then&lt;BR /&gt;sidea = TextBoxSidea.Text&lt;BR /&gt;Else&lt;BR /&gt;sidea = 0&lt;BR /&gt;End If&lt;/P&gt;&lt;P&gt;If Not isItNullString(TextBoxSidec.Text) Then&lt;BR /&gt;sidec = TextBoxSidec.Text&lt;BR /&gt;Else&lt;BR /&gt;sidec = 0&lt;BR /&gt;End If&lt;/P&gt;&lt;P&gt;If Not isItNullString(TextBoxAngleC.Text) Then&lt;BR /&gt;angleC = TextBoxAngleC.Text&lt;BR /&gt;Else&lt;BR /&gt;angleC = 0&lt;BR /&gt;End If&lt;/P&gt;&lt;P&gt;If Not isItNullString(TextBoxAngleB.Text) Then&lt;BR /&gt;angleB = TextBoxAngleB.Text&lt;BR /&gt;Else&lt;BR /&gt;angleB = 0&lt;BR /&gt;End If&lt;BR /&gt;End Sub&lt;/P&gt;&lt;P&gt;Public Function degreesToRadians(ByVal degrees As Double) As Double&lt;BR /&gt;Dim radians As Double&lt;BR /&gt;radians = (Math.PI * degrees) / 180&lt;BR /&gt;Return radians&lt;BR /&gt;End Function&lt;/P&gt;&lt;P&gt;Public Function radiansToDegrees(ByVal radians As Double) As Double&lt;BR /&gt;Dim degrees As Double&lt;BR /&gt;degrees = radians * (180 / Math.PI)&lt;BR /&gt;Return degrees&lt;BR /&gt;End Function&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;#Region " Calculate all Data "&lt;BR /&gt;Private Sub btnCalc_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCalc.Click&lt;BR /&gt;For aaa As Integer = 0 To 2 'I just repeated this 6 times because I have a lot of processing power&lt;BR /&gt;'you can do it twice.&lt;BR /&gt;feedValues()&lt;/P&gt;&lt;P&gt;pythagoreanTheoremThings()&lt;/P&gt;&lt;P&gt;angleSums()&lt;/P&gt;&lt;P&gt;angleBasWorkingAngle()&lt;/P&gt;&lt;P&gt;findangleC()&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Next&lt;/P&gt;&lt;P&gt;End Sub&lt;BR /&gt;#End Region&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;#Region " Clear all input boxes "&lt;BR /&gt;Public Sub ClearTextBox(ByVal root As Control)&lt;BR /&gt;For Each ctrl As Control In root.Controls&lt;BR /&gt;ClearTextBox(ctrl)&lt;BR /&gt;If TypeOf ctrl Is TextBox Then&lt;BR /&gt;CType(ctrl, TextBox).Text = String.Empty&lt;BR /&gt;End If&lt;BR /&gt;Next ctrl&lt;BR /&gt;End Sub&lt;BR /&gt;#End Region&lt;/P&gt;&lt;P&gt;Private Sub btnClear_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnClear.Click&lt;BR /&gt;ClearTextBox(Me)&lt;BR /&gt;End Sub&lt;/P&gt;&lt;P&gt;Private Sub btnExit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExit.Click&lt;BR /&gt;Me.Close()&lt;BR /&gt;End Sub&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;End Class&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Feb 2012 13:55:00 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/help-needed-with-triangle-solution-calculator-in-vb-net/m-p/3326923#M57268</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-02-10T13:55:00Z</dc:date>
    </item>
    <item>
      <title>Re: Help needed with Triangle solution calculator in VB.NET</title>
      <link>https://forums.autodesk.com/t5/net-forum/help-needed-with-triangle-solution-calculator-in-vb-net/m-p/3326947#M57269</link>
      <description>&lt;P&gt;hi steve&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;how do&amp;nbsp;you ensure&amp;nbsp;conditions a &amp;gt; b and a &amp;gt; c when user inputs?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;felix&lt;/P&gt;</description>
      <pubDate>Fri, 10 Feb 2012 14:12:06 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/help-needed-with-triangle-solution-calculator-in-vb-net/m-p/3326947#M57269</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-02-10T14:12:06Z</dc:date>
    </item>
    <item>
      <title>Re: Help needed with Triangle solution calculator in VB.NET</title>
      <link>https://forums.autodesk.com/t5/net-forum/help-needed-with-triangle-solution-calculator-in-vb-net/m-p/3326959#M57270</link>
      <description>&lt;P&gt;Well I should have said from the start, I am new to VB.NET, sorry. I am a CAD peron through and through, but when it comes to this I am not so good.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So to your answer, I am not sure, sorry.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I picked most of the code up from different examples, and sort of figured other bits out myself, I am one of those who learns by trial and error, or seeing examples and modifying from there. So I am relying on you guys to steer me in the right direction.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Steve&lt;/P&gt;</description>
      <pubDate>Fri, 10 Feb 2012 14:17:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/help-needed-with-triangle-solution-calculator-in-vb-net/m-p/3326959#M57270</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-02-10T14:17:26Z</dc:date>
    </item>
    <item>
      <title>Re: Help needed with Triangle solution calculator in VB.NET</title>
      <link>https://forums.autodesk.com/t5/net-forum/help-needed-with-triangle-solution-calculator-in-vb-net/m-p/3327021#M57271</link>
      <description>&lt;P&gt;no worries, i refer to the bit where you take the square root of the 2 variables the user chooses to put in, to calculate the missing 3rd in&amp;nbsp;the triangle: as long as side a is larger than side b and also larger than side c it should&amp;nbsp;work, however, should side a not be the largest side, the code could result in a square root of a negative number. to avoid this risk, restrictions are needed on the respective relative size of a, b and c to enforce that a &amp;gt; b and a &amp;gt; c. (this would explain why you get a 'correct' result for b and c, &amp;nbsp;as the [assumed] smaller sides, they are being &lt;EM&gt;added&lt;/EM&gt; for the square root.)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;something else to look out for is that the code doesn't know whether the triangle is in fact a rectengular one, as needed for pythargoras to hold true, i.e. taking the sqare root of the difference in sqares, it simple 'makes' it a rectangular one. (whether that's relevant here, i don't know.)&lt;/P&gt;</description>
      <pubDate>Fri, 10 Feb 2012 14:41:37 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/help-needed-with-triangle-solution-calculator-in-vb-net/m-p/3327021#M57271</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-02-10T14:41:37Z</dc:date>
    </item>
    <item>
      <title>Re: Help needed with Triangle solution calculator in VB.NET</title>
      <link>https://forums.autodesk.com/t5/net-forum/help-needed-with-triangle-solution-calculator-in-vb-net/m-p/3327057#M57272</link>
      <description>&lt;P&gt;Thanks Felix I do understand that, so have you any suggestions how I would code this to correct your suggestions?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Steve.&lt;/P&gt;</description>
      <pubDate>Fri, 10 Feb 2012 14:52:49 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/help-needed-with-triangle-solution-calculator-in-vb-net/m-p/3327057#M57272</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-02-10T14:52:49Z</dc:date>
    </item>
    <item>
      <title>Re: Help needed with Triangle solution calculator in VB.NET</title>
      <link>https://forums.autodesk.com/t5/net-forum/help-needed-with-triangle-solution-calculator-in-vb-net/m-p/3327395#M57273</link>
      <description>&lt;P&gt;more specifically, something like:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;public sub pythagorean theorem()&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if sideb = 0 then&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; if sidea &amp;gt; sidec then sqrt(squarea - sqaurec) ' continue as expected&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; else&amp;nbsp;'&amp;nbsp;swap sides before continue&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; storesidea = sidea&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sidea=sidec&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sidec=storesidea&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sqrt(squarea - sqaurec)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; endif&lt;/P&gt;&lt;P&gt;endif&lt;/P&gt;&lt;P&gt;... analogously for sidea &amp;gt; sideb&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;alternatively, i believe you could mask the input values with the form which sends the values in the 1st place, but that's not really much to do with acad anymore. hope this is closer to what you're looking for&lt;/P&gt;</description>
      <pubDate>Fri, 10 Feb 2012 16:44:40 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/help-needed-with-triangle-solution-calculator-in-vb-net/m-p/3327395#M57273</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-02-10T16:44:40Z</dc:date>
    </item>
    <item>
      <title>Re: Help needed with Triangle solution calculator in VB.NET</title>
      <link>https://forums.autodesk.com/t5/net-forum/help-needed-with-triangle-solution-calculator-in-vb-net/m-p/3327521#M57274</link>
      <description>&lt;P&gt;Hi Felix,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried your suggestion but it doesn't like it, I am using VB Studio 2010.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Feb 2012 17:23:22 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/help-needed-with-triangle-solution-calculator-in-vb-net/m-p/3327521#M57274</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-02-10T17:23:22Z</dc:date>
    </item>
    <item>
      <title>Re: Help needed with Triangle solution calculator in VB.NET</title>
      <link>https://forums.autodesk.com/t5/net-forum/help-needed-with-triangle-solution-calculator-in-vb-net/m-p/3327677#M57275</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The first is the first, before to solve a Pythagoras, you should check if the triplet (a,b,c) form a triangle, this is tested using the "Triangle Inequality" : the sum of any pair of sides must be greater than the other side (if equal it's a degenerated triangle, a line in this case):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Function IsTriangle(a as double,b as double, c as double) as Boolean&lt;/P&gt;&lt;P&gt;&amp;nbsp;If (a+b &amp;gt; c) andAlso (a+c &amp;gt; b) andAlso (c+b &amp;gt; a) then&lt;/P&gt;&lt;P&gt;&amp;nbsp; return True&lt;/P&gt;&lt;P&gt;&amp;nbsp;Else&lt;/P&gt;&lt;P&gt;&amp;nbsp; return False&lt;/P&gt;&lt;P&gt;End function&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now fix the position of the sides and be coherent with that, use a,b for the sides (or legs) and c for the hypotenuse, and check for that in the imput handler (just check if c &amp;gt; a And c &amp;gt; b) if not, then alert. And now evaluate Pythagoras &amp;nbsp;to check if the input values conform a stright triangle.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Gaston Nunez&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Feb 2012 18:41:34 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/help-needed-with-triangle-solution-calculator-in-vb-net/m-p/3327677#M57275</guid>
      <dc:creator>hgasty1001</dc:creator>
      <dc:date>2012-02-10T18:41:34Z</dc:date>
    </item>
    <item>
      <title>Re: Help needed with Triangle solution calculator in VB.NET</title>
      <link>https://forums.autodesk.com/t5/net-forum/help-needed-with-triangle-solution-calculator-in-vb-net/m-p/3327739#M57276</link>
      <description>&lt;P&gt;to round of my previous comments - and i apologise if this is too basic:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;in vs, place a breakpoint at the beginning of your code and use F8 to 'step' through each line as you debug. move the cursor over variables in the line that you are on or have just passed to check its value. this should give you&amp;nbsp;an indication of exactly&amp;nbsp;where values are as expected and where&amp;nbsp;they are not what they should be,&amp;nbsp;and&amp;nbsp;eventually where exceptions are thrown and the conclusion why. (i don't know if this applies to the express version of vs.)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;with regards to autocad and .net, this is the prefered point of 1st contact, if youl like:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="http://docs.autodesk.com/ACD/2011/ENU/filesMDG/WS1a9193826455f5ff2566ffd511ff6f8c7ca-4875.htm" target="_blank"&gt;http://docs.autodesk.com/ACD/2011/ENU/filesMDG/WS1a9193826455f5ff2566ffd511ff6f8c7ca-4875.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Feb 2012 19:06:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/help-needed-with-triangle-solution-calculator-in-vb-net/m-p/3327739#M57276</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-02-10T19:06:38Z</dc:date>
    </item>
    <item>
      <title>Re: Help needed with Triangle solution calculator in VB.NET</title>
      <link>https://forums.autodesk.com/t5/net-forum/help-needed-with-triangle-solution-calculator-in-vb-net/m-p/3327749#M57277</link>
      <description>&lt;P&gt;Thanks for all your help guys, but I do not have a clue what it is you are talking about. Sorry.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I have so far:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If i use the 3,4,5 as an example, and put in these known factors, this is what I get:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I enter side c as 4, side b as 3, press calculate and it gives me; c=4, b=3, a=5, angle B = 36.87, angle C = 53.13. So for a 3,4,5 triangle that is correct.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I enter angle B as 36.87, and side c as 4, press calculate and it gives me all the correct answers. I can do this with all the combinations of two inputs apart from;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;angle B and side a&lt;/P&gt;&lt;P&gt;angle C and side a&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Both come out as if you were dividing the sides by the Sine.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope that is not too confusing, because I think I have just confused myself.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Steve.&lt;/P&gt;</description>
      <pubDate>Fri, 10 Feb 2012 19:10:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/help-needed-with-triangle-solution-calculator-in-vb-net/m-p/3327749#M57277</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-02-10T19:10:10Z</dc:date>
    </item>
    <item>
      <title>Re: Help needed with Triangle solution calculator in VB.NET</title>
      <link>https://forums.autodesk.com/t5/net-forum/help-needed-with-triangle-solution-calculator-in-vb-net/m-p/3327791#M57278</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I insist that you are confused your self because the wrong positioned a,b,c values over the triangle in your screen grab. If &amp;nbsp;you have 3,4,5, then the value 5 MUST be over the hypotenuse, and NOT over a leg side. In other words where in the picture says "a" should be "c", and so with "c", given that &amp;nbsp;yo are solving the Pythagoras &amp;nbsp;in the standar form a*a+b*b=c*c. Other way just change the order of a,b,c in the formula.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Gaston Nunez&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Feb 2012 19:42:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/help-needed-with-triangle-solution-calculator-in-vb-net/m-p/3327791#M57278</guid>
      <dc:creator>hgasty1001</dc:creator>
      <dc:date>2012-02-10T19:42:54Z</dc:date>
    </item>
    <item>
      <title>Re: Help needed with Triangle solution calculator in VB.NET</title>
      <link>https://forums.autodesk.com/t5/net-forum/help-needed-with-triangle-solution-calculator-in-vb-net/m-p/3327935#M57279</link>
      <description>&lt;P&gt;There is nothing wrong with the pythagoras maths at all, it doesn't matter what you call the sides, they are just labels. It wouldn't matter if you called them side dog or side cat, it is the way in which you use them. If you look at the image I have attached you will see that it works ok for the pythagoras side of it.&lt;/P&gt;</description>
      <pubDate>Fri, 10 Feb 2012 20:53:59 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/help-needed-with-triangle-solution-calculator-in-vb-net/m-p/3327935#M57279</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-02-10T20:53:59Z</dc:date>
    </item>
    <item>
      <title>Re: Help needed with Triangle solution calculator in VB.NET</title>
      <link>https://forums.autodesk.com/t5/net-forum/help-needed-with-triangle-solution-calculator-in-vb-net/m-p/3327979#M57280</link>
      <description>&lt;P&gt;I would redo the code to make easier, but looking real quick think about this section of code.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt; If sideb = 0 Then
            sideb = Math.Sqrt((sidea * sidea) - (sidec * sidec))
            TextBoxSideb.Text = sideb

        ElseIf sidea = 0 Then
            sidea = Math.Sqrt((sideb * sideb) + (sidec * sidec))
            TextBoxSidea.Text = sidea

        ElseIf sidec = 0 Then
            sidec = Math.Sqrt((sidea * sidea) - (sideb * sideb))
            TextBoxSidec.Text = sidec
        End If&lt;/PRE&gt;&lt;P&gt;You are assuming that 2 sides will always have a value.&lt;/P&gt;&lt;P&gt;The sides really do not equal 0&amp;nbsp;you are using it as placeholder, might be better to take a different approach&lt;/P&gt;</description>
      <pubDate>Fri, 10 Feb 2012 21:12:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/help-needed-with-triangle-solution-calculator-in-vb-net/m-p/3327979#M57280</guid>
      <dc:creator>jeff</dc:creator>
      <dc:date>2012-02-10T21:12:52Z</dc:date>
    </item>
    <item>
      <title>Re: Help needed with Triangle solution calculator in VB.NET</title>
      <link>https://forums.autodesk.com/t5/net-forum/help-needed-with-triangle-solution-calculator-in-vb-net/m-p/3328341#M57282</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Thanks for your reply, I think it is very obvious that I don't know very much about VB programming, but I never proffessed too either. So I am asking for help on the solution please, in other words, what is the best way to code this calculator. As I mentioned earlier, I learn things by trial and error, and by seeing correct examples that I can then manipulate into my programmes.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Many thanks,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Steve&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 11 Feb 2012 03:24:47 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/help-needed-with-triangle-solution-calculator-in-vb-net/m-p/3328341#M57282</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-02-11T03:24:47Z</dc:date>
    </item>
    <item>
      <title>Re: Help needed with Triangle solution calculator in VB.NET</title>
      <link>https://forums.autodesk.com/t5/net-forum/help-needed-with-triangle-solution-calculator-in-vb-net/m-p/3328359#M57283</link>
      <description>&lt;P&gt;Hi guys,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have changed all the lettering around as per your instructions, and added some extra code, and it works properly.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for all your help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Steve.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;New code below, and image attached:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Imports System.String&lt;BR /&gt;Imports System.Math&lt;BR /&gt;Public Class Form1&lt;BR /&gt;Dim angleA As Single = 90&lt;BR /&gt;Dim angleB As Single&lt;BR /&gt;Dim angleC As Single&lt;BR /&gt;Dim sidea As Single&lt;BR /&gt;Dim sideb As Single&lt;BR /&gt;Dim sidec As Single&lt;/P&gt;&lt;P&gt;Private Sub NumericUpDown1_ValueChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles NumericUpDown1.ValueChanged&lt;BR /&gt;Controls.Add(NumericUpDown1)&lt;/P&gt;&lt;P&gt;End Sub&lt;/P&gt;&lt;P&gt;Public Function isItNullString(ByVal value) As Boolean&lt;BR /&gt;If value = "" Then&lt;BR /&gt;Return True&lt;BR /&gt;Else&lt;BR /&gt;Return False&lt;BR /&gt;End If&lt;BR /&gt;End Function&lt;/P&gt;&lt;P&gt;Public Sub pythagoreanTheoremThings()&lt;/P&gt;&lt;P&gt;If sidec &amp;lt;&amp;gt; 0 And sidea &amp;lt;&amp;gt; 0 And sideb = 0 Then&lt;BR /&gt;sideb = Math.Sqrt((sidec * sidec) - (sidea * sidea))&lt;BR /&gt;TextBoxSideb.Text = sideb&lt;/P&gt;&lt;P&gt;ElseIf sideb &amp;lt;&amp;gt; 0 And sidea &amp;lt;&amp;gt; 0 And sidec = 0 Then&lt;BR /&gt;sidec = Math.Sqrt((sideb * sideb) + (sidea * sidea))&lt;BR /&gt;TextBoxSidec.Text = sidec&lt;/P&gt;&lt;P&gt;ElseIf sidec &amp;lt;&amp;gt; 0 And sideb &amp;lt;&amp;gt; 0 And sidea = 0 Then&lt;BR /&gt;sidea = Math.Sqrt((sidec * sidec) - (sideb * sideb))&lt;BR /&gt;TextBoxSidea.Text = sidea&lt;BR /&gt;End If&lt;BR /&gt;End Sub&lt;/P&gt;&lt;P&gt;Public Sub angleSums()&lt;/P&gt;&lt;P&gt;If angleC = 0 And angleB &amp;lt;&amp;gt; 0 Then&lt;BR /&gt;angleC = 180 - angleA - angleB&lt;BR /&gt;TextBoxAngleC.Text = angleC&lt;BR /&gt;End If&lt;/P&gt;&lt;P&gt;If angleB = 0 And angleC &amp;lt;&amp;gt; 0 Then&lt;BR /&gt;angleB = 180 - angleA - angleC&lt;BR /&gt;TextBoxAngleB.Text = angleB&lt;BR /&gt;End If&lt;BR /&gt;End Sub&lt;/P&gt;&lt;P&gt;Public Sub angleBasWorkingAngle()&lt;/P&gt;&lt;P&gt;'Angle B and side b known, find side c&lt;BR /&gt;If angleB &amp;lt;&amp;gt; 0 And sideb &amp;lt;&amp;gt; 0 Then&lt;BR /&gt;sidec = sideb / Sin(degreesToRadians(angleB))&lt;BR /&gt;TextBoxSidec.Text = sidec&lt;BR /&gt;End If&lt;/P&gt;&lt;P&gt;'Angle B and side a known, find side b&lt;BR /&gt;If angleB &amp;lt;&amp;gt; 0 And sidea &amp;lt;&amp;gt; 0 Then&lt;BR /&gt;sideb = sidea * Tan(degreesToRadians(angleB))&lt;BR /&gt;TextBoxSideb.Text = sideb&lt;BR /&gt;End If&lt;/P&gt;&lt;P&gt;'Angle B and side b known, find side a&lt;BR /&gt;If angleB &amp;lt;&amp;gt; 0 And sideb &amp;lt;&amp;gt; 0 Then&lt;BR /&gt;sidea = sideb / Tan(degreesToRadians(angleB))&lt;BR /&gt;TextBoxSidea.Text = sidea&lt;BR /&gt;End If&lt;/P&gt;&lt;P&gt;'Angle B and side b known, find side a&lt;BR /&gt;If angleB &amp;lt;&amp;gt; 0 And sidec &amp;lt;&amp;gt; 0 Then&lt;BR /&gt;sidea = sidec * Cos(degreesToRadians(angleB))&lt;BR /&gt;TextBoxSidea.Text = sidea&lt;BR /&gt;End If&lt;/P&gt;&lt;P&gt;End Sub&lt;/P&gt;&lt;P&gt;Public Sub findangleC()&lt;/P&gt;&lt;P&gt;If angleC = 0 Then&lt;BR /&gt;'cos&lt;BR /&gt;angleC = radiansToDegrees(Acos(sideb / sidec))&lt;BR /&gt;TextBoxAngleC.Text = angleC&lt;BR /&gt;End If&lt;/P&gt;&lt;P&gt;End Sub&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Public Sub feedValues()&lt;/P&gt;&lt;P&gt;If Not isItNullString(TextBoxSideb.Text) Then&lt;BR /&gt;sideb = TextBoxSideb.Text&lt;BR /&gt;Else&lt;BR /&gt;sideb = 0&lt;BR /&gt;End If&lt;/P&gt;&lt;P&gt;If Not isItNullString(TextBoxSidea.Text) Then&lt;BR /&gt;sidea = TextBoxSidea.Text&lt;BR /&gt;Else&lt;BR /&gt;sidea = 0&lt;BR /&gt;End If&lt;/P&gt;&lt;P&gt;If Not isItNullString(TextBoxSidec.Text) Then&lt;BR /&gt;sidec = TextBoxSidec.Text&lt;BR /&gt;Else&lt;BR /&gt;sidec = 0&lt;BR /&gt;End If&lt;/P&gt;&lt;P&gt;If Not isItNullString(TextBoxAngleC.Text) Then&lt;BR /&gt;angleC = TextBoxAngleC.Text&lt;BR /&gt;Else&lt;BR /&gt;angleC = 0&lt;BR /&gt;End If&lt;/P&gt;&lt;P&gt;If Not isItNullString(TextBoxAngleB.Text) Then&lt;BR /&gt;angleB = TextBoxAngleB.Text&lt;BR /&gt;Else&lt;BR /&gt;angleB = 0&lt;BR /&gt;End If&lt;BR /&gt;End Sub&lt;/P&gt;&lt;P&gt;Public Function degreesToRadians(ByVal degrees As Double) As Double&lt;BR /&gt;Dim radians As Double&lt;BR /&gt;radians = (Math.PI * degrees) / 180&lt;BR /&gt;Return radians&lt;BR /&gt;End Function&lt;/P&gt;&lt;P&gt;Public Function radiansToDegrees(ByVal radians As Double) As Double&lt;BR /&gt;Dim degrees As Double&lt;BR /&gt;degrees = radians * (180 / Math.PI)&lt;BR /&gt;Return degrees&lt;BR /&gt;End Function&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;#Region " Calculate all Data "&lt;BR /&gt;Private Sub btnCalc_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCalc.Click&lt;BR /&gt;For aaa As Integer = 0 To 2 'I just repeated this 6 times because I have a lot of processing power&lt;BR /&gt;'you can do it twice.&lt;BR /&gt;feedValues()&lt;/P&gt;&lt;P&gt;pythagoreanTheoremThings()&lt;/P&gt;&lt;P&gt;angleSums()&lt;/P&gt;&lt;P&gt;angleBasWorkingAngle()&lt;/P&gt;&lt;P&gt;findangleC()&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Next&lt;/P&gt;&lt;P&gt;End Sub&lt;BR /&gt;#End Region&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;#Region " Clear all input boxes "&lt;BR /&gt;Public Sub ClearTextBox(ByVal root As Control)&lt;BR /&gt;For Each ctrl As Control In root.Controls&lt;BR /&gt;ClearTextBox(ctrl)&lt;BR /&gt;If TypeOf ctrl Is TextBox Then&lt;BR /&gt;CType(ctrl, TextBox).Text = String.Empty&lt;BR /&gt;End If&lt;BR /&gt;Next ctrl&lt;BR /&gt;End Sub&lt;BR /&gt;#End Region&lt;/P&gt;&lt;P&gt;Private Sub btnClear_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnClear.Click&lt;BR /&gt;ClearTextBox(Me)&lt;BR /&gt;End Sub&lt;/P&gt;&lt;P&gt;Private Sub btnExit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExit.Click&lt;BR /&gt;Me.Close()&lt;BR /&gt;End Sub&lt;/P&gt;</description>
      <pubDate>Sat, 11 Feb 2012 04:27:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/help-needed-with-triangle-solution-calculator-in-vb-net/m-p/3328359#M57283</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-02-11T04:27:10Z</dc:date>
    </item>
    <item>
      <title>Re: Help needed with Triangle solver</title>
      <link>https://forums.autodesk.com/t5/net-forum/help-needed-with-triangle-solution-calculator-in-vb-net/m-p/3659296#M57284</link>
      <description>&lt;P&gt;..how to make triangle solver?where can i create like that one?i really need it because it is our project in trigonometry.thanks for the immediate respond=)&lt;/P&gt;</description>
      <pubDate>Mon, 15 Oct 2012 09:24:56 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/help-needed-with-triangle-solution-calculator-in-vb-net/m-p/3659296#M57284</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-10-15T09:24:56Z</dc:date>
    </item>
  </channel>
</rss>

