I have a simple function program to calculate the inverse sine of a function. The one thing that baffles me is you can only calculate it using numbers between -1 and 1. I need to show an error message when the user tries to use like a "2" without using a message box. My code will be after this and I tried an IF conditional statement and it illustrates what I am trying to do. Naturally, what I i tried did not work.
Public Function ARCSIN(x As Single) As Single
Dim pi As Single, y As String
pi = 4 * Atn(1)
ARCSIN = Atn(x / Sqr(1 - x * x))
ARCSIN = ARCSIN * 180 / pi
Select Case (x)
Case Is >= -1
Case Is <= 1
Case Else
y = "Your Input will result in an undefined answer. Please input a number between -1 and 1."
End Select
End Function
Bookmarks