sin(角度值)同理cos,tan
創(chuàng)新互聯(lián)公司于2013年成立,是專業(yè)互聯(lián)網(wǎng)技術(shù)服務(wù)公司,擁有項(xiàng)目成都網(wǎng)站設(shè)計(jì)、網(wǎng)站制作網(wǎng)站策劃,項(xiàng)目實(shí)施與項(xiàng)目整合能力。我們以讓每一個(gè)夢(mèng)想脫穎而出為使命,1280元昆玉做網(wǎng)站,已為上家服務(wù),為昆玉各地企業(yè)和個(gè)人服務(wù),聯(lián)系電話:13518219792
Atn()是VB反正切函數(shù),VB不提供其他反三角函數(shù),不過可以用下列公式導(dǎo)出:
Inverse Sine (反正弦):
Arcsin(X) = Atn(X / Sqr(-X * X + 1))
Inverse Cosine (反余弦):
Arccos(X) = Atn(-X / Sqr(-X * X + 1)) + 2 * Atn(1)
Inverse Secant (反正割):
Arcsec(X) = Atn(X / Sqr(X * X - 1)) + Sgn((X) - 1) * (2 * Atn(1))
Inverse Cosecant (反余割):
Arccosec(X) = Atn(X / Sqr(X * X - 1)) + (Sgn(X) - 1) * (2 * Atn(1))
以上這些公式,其實(shí)就是應(yīng)用了數(shù)學(xué)中的各類三角函數(shù)和正切函數(shù)之間的關(guān)系導(dǎo)出的。其中需要注意的是其中的 X 不能等于正負(fù)1。(引用-_-)
x都是弧度制
VB6
Atn
VB.net
Math.Atan
Cot是余切。一般編程語言中至少要包含Sin,Cos,ArcTan三個(gè)三角函數(shù),其他的都可以用這幾個(gè)導(dǎo)出。經(jīng)常地,編程語言還包括Tan,ATan2這幾個(gè)三角函數(shù)。
有幾個(gè)地方要注意:
1、VB中的三角函數(shù)的角度全部是用弧度制表示的,如果是度數(shù)的話,應(yīng)先乘以180再除以π轉(zhuǎn)成弧度,再用函數(shù)計(jì)算結(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