This is a small calculator i'm writing. I just need help with VB.Net formulas for cotangent, secant, and cosecant.
Given an angle (NumericUpDown1.Value), how would i complete this code?
I'm just testing this now. Should the angle be given in Radians?Code:Private Sub calculate() Select Case ComboBox1.SelectedIndex Case 0 ' sine(sin) Label3.Text = $"Math.Sin({NumericUpDown1.Value})" Label4.Text = Math.Sin(NumericUpDown1.Value).ToString Case 1 ' cosine(cos) Label3.Text = $"Math.Cos({NumericUpDown1.Value})" Label4.Text = Math.Cos(NumericUpDown1.Value).ToString Case 2 ' tangent(tan) Label3.Text = $"Math.Tan({NumericUpDown1.Value})" Label4.Text = Math.Tan(NumericUpDown1.Value).ToString Case 3 ' cotangent(cot) Label3.Text = $"1 / Math.Tan({NumericUpDown1.Value})" Label4.Text = 1 / Math.Tan(NumericUpDown1.Value).ToString '??? Case 4 ' secant(sec) Label3.Text = "" Label4.Text = "" '??? Case 5 ' cosecant(csc) Label3.Text = "" Label4.Text = "" '??? Case Else ' -1 Label3.Text = "" Label4.Text = "" End Select End Sub




Reply With Quote