99偷拍视频精品区一区二,口述久久久久久久久久久久,国产精品夫妇激情啪发布,成人永久免费网站在线观看,国产精品高清免费在线,青青草在线观看视频观看,久久久久久国产一区,天天婷婷久久18禁,日韩动漫av在线播放直播

vb.net求正弦 編程求正弦值

有誰知道VB編程中運算sin、cos、tan、cot的程序怎么寫?

sin(角度值)同理cos,tan

克東網(wǎng)站建設(shè)公司創(chuàng)新互聯(lián),克東網(wǎng)站設(shè)計制作,有大型網(wǎng)站制作公司豐富經(jīng)驗。已為克東千余家提供企業(yè)網(wǎng)站建設(shè)服務(wù)。企業(yè)網(wǎng)站搭建\成都外貿(mào)網(wǎng)站制作要多少錢,請找那個售后服務(wù)好的克東做網(wǎng)站的公司定做!

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))

以上這些公式,其實就是應(yīng)用了數(shù)學(xué)中的各類三角函數(shù)和正切函數(shù)之間的關(guān)系導(dǎo)出的。其中需要注意的是其中的 X 不能等于正負(fù)1。(引用-_-)

x都是弧度制

在visual studio中編寫VB程序時sin cos為何不識別,如何才能輸入三角函數(shù)?

vb.net提供了許多命名空間,三角函數(shù)在?System.Math 命名里:

在代碼窗口的最上面添加如下代碼:

Imports System.Math

見下圖:

在vb中。如何進(jìn)行三角函數(shù)的程序代碼編寫

有幾個地方要注意:

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

大佬們~VisualStudio中vb.net如何畫三角函數(shù)圖像?

VB系統(tǒng)的坐標(biāo)原點在左上角,X軸的正方向是水平向右,而Y軸的正方向是垂直向下。所以,要繪制三角函數(shù)的曲線,自己可以通過改變點坐標(biāo)的方法來實現(xiàn),當(dāng)然,VB.NET提供了相應(yīng)的方法可以來實現(xiàn)坐標(biāo)變換,也可以通過VB.Net的Graphics類提供的平移、旋轉(zhuǎn)等轉(zhuǎn)換來實現(xiàn)。

下面是我通過自己變換實現(xiàn)的示例,提供參考;我的環(huán)境是VB.NET 2010

Imports System.Math

Public Class Form1

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

? '1,獲得一個Graphics對象

? Dim MyGraphics As Graphics

? MyGraphics = PictureBox1.CreateGraphics

? '2,定義一個Pen對象,用于繪制圖形(輪廓線)

? Dim MyPen As New Pen(Color.Black, 1)

? '3,定義一個Brush對象,用于填充圖形(如果需要填充的話)

? Dim MyBrush As New SolidBrush(Color.Orange)

? MyGraphics.DrawLine(MyPen, 0, 200, 700, 200)

End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click

? '1,獲得一個Graphics對象

? Dim MyGraphics As Graphics

? MyGraphics = PictureBox1.CreateGraphics

? '2,定義一個Pen對象,用于繪制圖形(輪廓線)

? Dim MyPen As New Pen(Color.Black, 1)

? '3,定義一個Brush對象,用于填充圖形(如果需要填充的話)

? Dim MyBrush As New SolidBrush(Color.Orange)

? '聲明橫向和縱向比例變量

? Dim Heng As Integer = 20

? Dim Zong As Integer = 50

? '先獲得正弦值,保存到點坐標(biāo)數(shù)組

? Dim MyPoints(700) As Point

? Dim i As Integer

? For i = 0 To 700

? ? ? MyPoints(i) = New Point(i * Heng, 200 + Sin(i) * Zong)

? Next

? '采用繪制光滑線連接點的方式繪制曲線

? MyGraphics.DrawCurve(MyPen, MyPoints)

End Sub

End Class

顯示的效果圖:

網(wǎng)頁名稱:vb.net求正弦 編程求正弦值
標(biāo)題URL:http://www.yijiale78.com/article0/dohioio.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供網(wǎng)站營銷、微信公眾號、網(wǎng)站導(dǎo)航ChatGPT、網(wǎng)站設(shè)計公司、網(wǎng)站維護(hù)

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)

成都定制網(wǎng)站網(wǎng)頁設(shè)計