Advertisement
Guest User

Untitled

a guest
Jan 24th, 2017
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.05 KB | None | 0 0
  1. Private Sub cmdcalculate_Click()
  2.  
  3. Dim x As Single
  4. Dim a As Single, b As Single, c As Single
  5. a = Val(txta.Text)
  6. b = Val(txtb.Text)
  7. c = Val(txtc.Text)
  8.  
  9. If a + b > c And b + c > a And a + c > b Then
  10. lblis.Visible = True
  11. Else
  12. lblisnot.Visible = True
  13. End If
  14.  
  15. If a ^ 2 + b ^ 2 > c ^ 2 Or a ^ 2 + c ^ 2 > b ^ 2 Or b ^ 2 + c ^ 2 > a ^ 2 Then
  16. lblacute.Visible = True
  17. lblright.Visible = False
  18. lblobtuse.Visible = False
  19. Else
  20. lblacute.Visible = False
  21. End If
  22.  
  23. If a ^ 2 + b ^ 2 = c ^ 2 Or a ^ 2 + c ^ 2 = b ^ 2 Or b ^ 2 + c ^ 2 = a ^ 2 Then
  24. lblright.Visible = True
  25. lblacute.Visible = False
  26. lblobtuse.Visible = False
  27.  
  28. Else
  29. lblright.Visible = False
  30. End If
  31.  
  32. If a ^ 2 + b ^ 2 < c ^ 2 Or a ^ 2 + c ^ 2 < b ^ 2 Or b ^ 2 + c ^ 2 < a ^ 2 Then
  33. lblobtuse.Visible = True
  34. lblacute.Visible = False
  35. lblright.Visible = False
  36. Else
  37. lblobtuse.Visible = False
  38. End If
  39.  
  40. If a = b And a = c And b = c Then
  41. lblequ.Visible = True
  42. lbliso.Visible = False
  43. lblscal.Visible = False
  44. ElseIf a = b And a <> c And b <> c Or a = c And a <> b And b <> c Or b = c And b <> a And c <> a Then
  45. lbliso.Visible = True
  46. lblscal.Visible = False
  47. lblequ.Visible = False
  48. ElseIf a <> b <> c Then
  49. lblscal.Visible = True
  50. lblequ.Visible = False
  51. lbliso.Visible = False
  52. End If
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61. Dim angAr As Double
  62. Dim angAd As Double
  63.  
  64. x = (b ^ 2 + c ^ 2 - a ^ 2) / (2 * b * c)
  65. angAr = Atn(-x / Sqr(-x * x + 1)) + 2 * Atn(1)
  66. angAd = ((angAr / 3.14159265358979) * 180)
  67. lblaa.Caption = angAd
  68.  
  69.  
  70. Dim angBr As Double
  71. Dim angBd As Double
  72.  
  73. x = (a ^ 2 + c ^ 2 - b ^ 2) / (2 * a * c)
  74. angBr = Atn(-x / Sqr(-x * x + 1)) + 2 * Atn(1)
  75. angBd = ((angBr / 3.14159265358979) * 180)
  76. lblab.Caption = angBd
  77.  
  78. Dim angCr As Double
  79. Dim angCd As Double
  80.  
  81. x = (a ^ 2 + b ^ 2 - c ^ 2) / (2 * a * b)
  82. angCr = Atn(-x / Sqr(-x * x + 1)) + 2 * Atn(1)
  83. angCd = ((angCr / 3.14159265358979) * 180)
  84. lblac.Caption = angCd
  85.  
  86.  
  87.  
  88.  
  89. Dim perm As Single
  90. perm = (txta * 1) + (txtb * 1) + (txtc * 1)
  91. lblperm.Caption = perm
  92.  
  93. cmdarea.SetFocus
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement