Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.
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 |
---|---|---|---|
Access question - internal training | 9 | 65 | |
VB6 - Compare and highlight cell not the same | 3 | 49 | |
Restarting the Universe - A Thought Experiment | 19 | 86 | |
How to make an ADE file by code? | 11 | 82 |
Join the community of 500,000 technology professionals and ask your questions.
Connect with top rated Experts
18 Experts available now in Live!