有几个地方要注意:
滨城网站制作公司哪家好,找创新互联!从网页设计、网站建设、微信开发、APP开发、成都响应式网站建设等网站项目制作,到程序开发,运营维护。创新互联于2013年成立到现在10年的时间,我们拥有了丰富的建站经验和运维经验,来保证我们的工作的顺利进行。专注于网站建设就选创新互联。
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
反正弦 : Arcsin(X) = Atn(X / Sqr(-X * X + 1))
反余弦: Arccos(X) = Atn(-X / Sqr(-X * X + 1)) + 2 * Atn(1)
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)