CodeItBetter Programming Another VB Programming Blog

How to Calculate ArcSin And ArcCos

Posted on January 5, 2009
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
'Math - How to Calculate ArcSin And ArcCos

Option Explicit
 
'We can use ArcTan function, to calculate ArcSin and ArcCos.

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 Main()
    MsgBox "ArcSin(1.5) = " & ArcSin(1.5)
    MsgBox "ArcCos(1.5) = " & ArcCos(1.5)
End Sub
Filed under: Math Leave a comment
Comments (0) Trackbacks (0)

No comments yet.


Leave a comment


 

No trackbacks yet.