vb.net余弦函数应用 vb中余弦函数代码
用vb编程的计算器怎么样编写正弦和余弦函数
一般都是用角度值求三角函数,需要把角度值换算成弧度值。代码如下:
成都创新互联公司自2013年起,是专业互联网技术服务公司,拥有项目成都做网站、成都网站设计网站策划,项目实施与项目整合能力。我们以让每一个梦想脱颖而出为使命,1280元北票做网站,已为上家服务,为北票各地企业和个人服务,联系电话:13518219792
Dim a
Dim pin As Double
Private Sub Form_Load()
pin = 3.14159265358979
End Sub
Private Sub Command1_Click() '求sin按键
a = Sin((Tex_in) * 2 * pin / 360)
Tex_out = a
End Sub
Private Sub Command2_Click() ' 求cos按键
a = Cos((Tex_in) * 2 * pin / 360)
Tex_out = a
End Sub
怎样用vb求余弦?怎样编写,谢谢
Option Explicit
Const Pi As Double = 3.1415626
Sub 测试()
Dim X As Double, JD As Double,HD As Double
JD = 30 '角度,度
HD = JD * Pi / 180 '弧度
'取指定角度的余弦
X = Cos(HD)
'根据余弦求度数
X = ArcCos(X, 4)
MsgBox "根据余弦求度数: ArcCos(X)====" X
End Sub
Public Function ArcCos(ByVal X As Double, ByVal Dic As Integer) As Double
'根据余弦求度数
'参数:余弦(单位弧度),小数位数
'返回:角度,度数(十进制)
ArcCos = Atn(-X / Sqr(-X * X + 1)) + 2 * Atn(1)
ArcCos = Round(ArcCos / Pi * 180, Dic)
End Function
不知对你有否帮助?
家底儿分求助在线等:知道一个角度的余弦值,在VB中,如何应用数学函数,计算出这个角度!谢谢
Secant(正割) Sec(X) = 1 / Cos(X)
Cosecant(余割) Cosec(X) = 1 / Sin(X)
Cotangent(余切) Cotan(X) = 1 / Tan(X)
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))
Inverse Cotangent
(反余切)
Arccotan(X) = Atn(X) + 2 * Atn(1)
Hyperbolic Sine
(双曲正弦)
HSin(X) = (Exp(X) - Exp(-X)) / 2
Hyperbolic Cosine
(双曲余弦)
HCos(X) = (Exp(X) + Exp(-X)) / 2
Hyperbolic Tangent
(双曲正切)
HTan(X) = (Exp(X) - Exp(-X)) / (Exp(X) + Exp(-X))
Hyperbolic Secant
(双曲正割)
HSec(X) = 2 / (Exp(X) + Exp(-X))
Hyperbolic Cosecant(双曲余割) HCosec(X) = 2 / (Exp(X) - Exp(-X))
Hyperbolic Cotangent(双曲余切) HCotan(X) = (Exp(X) + Exp(-X)) / (Exp(X) - Exp(-X))
Inverse Hyperbolic Sine(反双曲正弦) HArcsin(X) = Log(X + Sqr(X * X + 1))
Inverse Hyperbolic Cosine(反双曲余弦) HArccos(X) = Log(X + Sqr(X * X - 1))
Inverse Hyperbolic Tangent(反双曲正切) HArctan(X) = Log((1 + X) / (1 - X)) / 2
Inverse Hyperbolic Secant(反双曲正割) HArcsec(X) = Log((Sqr(-X * X + 1) + 1) / X)
Inverse Hyperbolic Cosecant HArccosec(X) = Log((Sgn(X) * Sqr(X * X + 1) + 1) / X)
Inverse Hyperbolic Cotangent
(反双曲余切)
HArccotan(X) = Log((X + 1) / (X - 1)) / 2
以 N 为底的对数 LogN(X) = Log(X) / Log(N)
本文题目:vb.net余弦函数应用 vb中余弦函数代码
本文地址:http://cdiso.cn/article/doochji.html