Welcome, Guest. Please login or register.
Did you miss your activation email?
May 24, 2012, 08:19:30 PM

Login with username, password and session length
Search:     Advanced search
* Home Help Search Calendar Links Login Register
+  Machsupport Forum
|-+  Mach Discussion
| |-+  VB and the development of wizards
| | |-+  No acos/asin?
Pages: 1   Go Down
Print
Author Topic: No acos/asin?  (Read 908 times)
0 Members and 1 Guest are viewing this topic.
flick
Active Member

Offline Offline

Posts: 15


View Profile
« on: July 11, 2009, 07:08:27 PM »

There's an atn function, to calculate arctan's... but no inverse functions for the other two? Am I overlooking them somehow? I need them!
Logged
ger21
Global Moderator
*
Offline Offline

Posts: 2,612



View Profile WWW
« Reply #1 on: July 11, 2009, 08:42:46 PM »

Google "VB asin" and you see how to code them yourself. Apparently they are not included in VB.
Logged

flick
Active Member

Offline Offline

Posts: 15


View Profile
« Reply #2 on: July 12, 2009, 02:21:47 AM »

Thanks.  Those are a lot cleaner than the guess & test versions I came up with. Wink
Logged
morg2borg
Active Member

Offline Offline

Posts: 24



View Profile
« Reply #3 on: May 22, 2011, 05: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

Logged
Pages: 1   Go Up
Print
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!