十年网站开发经验 + 多家企业客户 + 靠谱的建站团队
量身定制 + 运营维护+专业推广+无忧售后,网站问题一站解决
反正切: Atn
安义网站建设公司创新互联,安义网站设计制作,有大型网站制作公司丰富经验。已为安义1000多家提供企业网站建设服务。企业网站搭建\外贸网站建设要多少钱,请找那个售后服务好的安义做网站的公司定做!
反正弦 : Arcsin(X) = Atn(X / Sqr(-X * X + 1))
反余弦: Arccos(X) = Atn(-X / Sqr(-X * X + 1)) + 2 * Atn(1)
有几个地方要注意:
1、VB中的三角函数的角度全部是用弧度制表示的,如果是度数的话,应先乘以180再除以π转成弧度,再用函数计算结果。
2、VB中直接支持的三角函数有:Sin()、Cos()、Tan(),如果涉及到其它三角函数,可以从下面列出的代码中自己选择相应的函数:
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反正切函数,VB不提供其他反三角函数,不过可以用下列公式导出:ArcTan(X) = Atn(X)Arcsin(X) = Atn(X / Sqr(-X * X + 1))Arccos(X) = Atn(-X / Sqr(-X * X + 1)) + 2 * Atn(1)