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
If you are experiencing a similar issue, please ask a related question
Title | # Comments | Views | Activity |
---|---|---|---|
passing parameter in sql procedure | 9 | 56 | |
Math Question | 1 | 76 | |
Hide vba in gp | 7 | 82 | |
Most Consistent Performer | 4 | 20 |
Join the community of 500,000 technology professionals and ask your questions.
Connect with top rated Experts
25 Experts available now in Live!