本文介绍了图正弦波......?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨...

我已经制定了一个正弦波代码:

  private   double  DegreeToRadian( double  angle)
{
return Math.PI * angle / int .Parse(textBox3.Text);
}

私有 void 绘制( double N)
{
int Yoffset = panel1.Height / 2 ;
Graphics G = panel1.CreateGraphics();
Pen P = new 笔(Color.Yellow, 1 .5f);
float x1,y1;
for double X = 0 ; X < = 360 ; X ++)
{
x1 = ( float )X;
y1 = Yoffset +(( float )Math.Sin(DegreeToRadian(X * N))* int .Parse(textBox2.Text));
G.DrawRectangle(P,x1,y1,.5f,.5f);
}
P.Dispose();
}





然后Button_Click:



绘制( int  .Parse(textBox1.Text)); 





现在我想...我如何以赫兹显示频率?

解决方案

Hi ...
I've drawn up a code of sine wave :

private double DegreeToRadian(double angle)
        {
            return Math.PI * angle / int.Parse(textBox3.Text);
        }

        private void Draw(double N)
        {
            int Yoffset = panel1.Height / 2;
            Graphics G = panel1.CreateGraphics();
            Pen P = new Pen(Color.Yellow, 1.5f);
            float x1, y1;
            for (double X = 0; X <= 360; X++)
            {
                x1 = (float)X;
                y1 = Yoffset + ((float)Math.Sin(DegreeToRadian(X * N)) * int.Parse(textBox2.Text));
                G.DrawRectangle(P, x1, y1, .5f, .5f);
            }
            P.Dispose();
        }



Then Button_Click :

Draw(int.Parse(textBox1.Text));



Now I want ... How do I display the frequency in hertz?

解决方案


这篇关于图正弦波......?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

05-23 07:30