反正切: Atn
安義網(wǎng)站建設(shè)公司創(chuàng)新互聯(lián),安義網(wǎng)站設(shè)計制作,有大型網(wǎng)站制作公司豐富經(jīng)驗。已為安義1000多家提供企業(yè)網(wǎng)站建設(shè)服務(wù)。企業(yè)網(wǎng)站搭建\外貿(mào)網(wǎng)站建設(shè)要多少錢,請找那個售后服務(wù)好的安義做網(wǎng)站的公司定做!
反正弦 : Arcsin(X) = Atn(X / Sqr(-X * X + 1))
反余弦: Arccos(X) = Atn(-X / Sqr(-X * X + 1)) + 2 * Atn(1)
有幾個地方要注意:
1、VB中的三角函數(shù)的角度全部是用弧度制表示的,如果是度數(shù)的話,應(yīng)先乘以180再除以π轉(zhuǎn)成弧度,再用函數(shù)計算結(jié)果。
2、VB中直接支持的三角函數(shù)有:Sin()、Cos()、Tan(),如果涉及到其它三角函數(shù),可以從下面列出的代碼中自己選擇相應(yīng)的函數(shù):
Function
Sec(X)
As
Double
'正割
Sec
=
1
/
Cos(Angle)
End
Function
Function
Csc(X)
As
Double
'余割
Csc
=
1
/
Sin(Angle)
End
Function
Function
Cot(X)
As
Double
'余切
Cot
=
1
/
Tan(Angle)
End
Function
Function
ArcSin(X)
As
Double
'反正弦
ArcSin
=
Atn(X
/
Sqr(-X
*
X
+
1))
End
Function
Function
ArcCos(X)
As
Double
'反余弦
ArcCos
=
Atn(-X
/
Sqr(-X
*
X
+
1))
+
2
*
Atn(1)
End
Function
Function
ArcSec(X)
As
Double
'反正割
ArcSec
=
Atn(X
/
Sqr(X
*
X
-
1))
+
Sgn((X)
-
1)
*
(2
*
Atn(1))
End
Function
Function
ArcCsc(X)
As
Double
'反余割
ArcCsc
=
Atn(X
/
Sqr(X
*
X
-
1))
+
(Sgn(X)
-
1)
*
(2
*
Atn(1))
End
Function
Function
ArcCot(X)
As
Double
'反余切
ArcCot
=
Atn(X)
+
2
*
Atn(1)
End
Function
Function
HSin(X)
As
Double
'雙曲正弦
HSin
=
(Exp(X)
-
Exp(-X))
/
2
End
Function
Function
HCos(X)
As
Double
'雙曲余弦
HCos
=
(Exp(X)
+
Exp(-X))
/
2
End
Function
Function
HTan(X)
As
Double
'雙曲正切
HTan
=
(Exp(X)
-
Exp(-X))
/
(Exp(X)
+
Exp(-X))
End
Function
Function
HSec(X)
As
Double
'雙曲正割
HSec
=
2
/
(Exp(X)
+
Exp(-X))
End
Function
Function
HCsc(X)
As
Double
'雙曲余割
HCsc
=
2
/
(Exp(X)
-
Exp(-X))
End
Function
Function
HCot(X)
As
Double
'雙曲余切
HCot
=
(Exp(X)
+
Exp(-X))
/
(Exp(X)
-
Exp(-X))
End
Function
Function
HArcsin(X)
As
Double
'反雙曲正弦
HArcsin
=
Log(X
+
Sqr(X
*
X
+
1))
End
Function
Function
HArccos(X)
As
Double
'反雙曲余弦
HArccos
=
Log(X
+
Sqr(X
*
X
-
1))
End
Function
Function
HArctan(X)
As
Double
'反雙曲正切
HArctan
=
Log((1
+
X)
/
(1
-
X))
/
2
End
Function
Function
HArcsec(X)
As
Double
'反雙曲正割
HArcsec
=
Log((Sqr(-X
*
X
+
1)
+
1)
/
X)
End
Function
Function
HArccsc(X)
As
Double
'反雙曲余割
HArccsc
=
Log((Sgn(X)
*
Sqr(X
*
X
+
1)
+
1)
/
X)
End
Function
Function
HArccot(X)
As
Double
'反雙曲余切
HArccot
=
Log((X
+
1)
/
(X
-
1))
/
2
End
Function
Atn()是VB反正切函數(shù),VB不提供其他反三角函數(shù),不過可以用下列公式導(dǎo)出:ArcTan(X) = Atn(X)Arcsin(X) = Atn(X / Sqr(-X * X + 1))Arccos(X) = Atn(-X / Sqr(-X * X + 1)) + 2 * Atn(1)