<form id="hz9zz"></form>
  • <form id="hz9zz"></form>

      <nobr id="hz9zz"></nobr>

      <form id="hz9zz"></form>

    1. 明輝手游網中心:是一個免費提供流行視頻軟件教程、在線學習分享的學習平臺!

      正弦函數的繪制的一種方法

      [摘要]Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim G As Graphics G = ...
      Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

       

       

              Dim G As Graphics

       

              G = PictureBox1.CreateGraphics()

              '移動坐標原點(那么原點下就變成了(20,pictruebox1.height\2))

              G.TranslateTransform(20, PictureBox1.Height \ 2)

              '繪制X軸與Y

              'Y

              G.DrawLine(Pens.Black, 20, -PictureBox1.Height \ 2, 20, PictureBox1.Height \ 2)

              'X

              G.DrawLine(Pens.Black, -20, 0, PictureBox1.Width, 0)

              '正弦函數

              Dim X, Y As Double

              For X = 0 To 400 Step 0.002

                  Y = 60 * Math.Sin(2 * 3.1415926 * X / 200)

                  G.DrawLine(Pens.Blue, CInt(X), 0, CInt(X), CInt(Y))

                  Application.DoEvents()

              Next

              For X = 0 To 400 Step 0.002

                  Y = 60 * Math.Sin(2 * 3.1415926 * X / 200)

                  G.DrawLine(Pens.Red, CInt(X), 0, CInt(X), CInt(Y))

                  Application.DoEvents()

              Next

          End Sub





      日韩精品一区二区三区高清