Are you talking about the slope of the line?
Public Const Pi As Double = 3.14159265358979
Sub test()
Dim side As Long
Dim base As Long
Dim hyp As Long
Dim opp As Long
Dim angle As Double
side = 75
base = 50
hyp = side
opp = base / 2
' multiplying by 2 because we were solving for half the original triangle.
' multiplying by 180 / PI to convert radians to to degrees
angle = arcSin(opp / hyp) * 180 / Pi * 2
End Sub
' arc sine
' error if value is outside the range [-1,1]
Function arcSin(value As Double) As Double
If Abs(value) <> 1 Then
arcSin = Atn(value / Sqr(1 - value * value))
Else
arcSin = 1.5707963267949 * Sgn(value)
End If
End Function
Title | # Comments | Views | Activity |
---|---|---|---|
Best way to parse out a json string in VB6? | 10 | 69 | |
Two Dice Roll Probabilities | 3 | 44 | |
VBA filters | 2 | 37 | |
deducing meaning of a word from its prefix-question | 7 | 54 |
Join the community of 500,000 technology professionals and ask your questions.
Connect with top rated Experts
8 Experts available now in Live!