1
VB and the development of wizards / Re: No acos/asin?
« on: May 22, 2011, 06:18:35 PM »
Function ArcSin(X As Double) As Double
ArcSin = Atn(X / Sqr(-X * X + 1))
End Function
Function ArcCos(X As Double) As Double
ArcCos = Atn(-X / Sqr(-X * X + 1)) + 2 * Atn(1)
End Function
Private Sub Command1_Click()
' replace the 0.5 below with the degree (in radians) that
' you want to calculate its ArcSin or ArcCos value
MsgBox "ArcSin(0.5) = " & ArcSin(0.5)
MsgBox "ArcCos(0.5) = " & ArcCos(0.5)
End Sub
ArcSin = Atn(X / Sqr(-X * X + 1))
End Function
Function ArcCos(X As Double) As Double
ArcCos = Atn(-X / Sqr(-X * X + 1)) + 2 * Atn(1)
End Function
Private Sub Command1_Click()
' replace the 0.5 below with the degree (in radians) that
' you want to calculate its ArcSin or ArcCos value
MsgBox "ArcSin(0.5) = " & ArcSin(0.5)
MsgBox "ArcCos(0.5) = " & ArcCos(0.5)
End Sub