菜鸟求动态正弦曲线代码 菜鸟求一个用线程编的正弦曲线代码!!最好能在一个自定义的坐标空间中运行!! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 http://www.2cto.com/kf/201007/52462.html先弄明白如何画正弦曲线吧 private void Form1_Paint(object sender, PaintEventArgs e) { DrawSin(e.Graphics); } private void DrawSin(Graphics g) { Pen p = new Pen(Color.Black, 1); int Zoom = 10; //放大倍数 Point center = new Point(100, 100); //原点 float x1 = (float)(0 * Math.PI * Zoom / 180 + center.X); float y1 = (float)(Math.Sin(0 * Math.PI / 180) * Zoom + center.Y); g.DrawLine(p, 0, center.Y, 1000, center.Y); //x坐标轴 g.DrawLine(p, center.X, 0, center.X , 1000); //y坐标轴 for (int i = 1; i < 360*5; i++) //角 { float x2 = (float)(i * Math.PI * Zoom / 180 + center.X); float y2 = (float)Math.Sin(i * Math.PI / 180) *(-1) * Zoom+center.Y; g.DrawLine(p, x1, y1, x2, y2); x1 = x2; y1 = y2; } } object对象转换为泛型集合的问题,求大牛指点 c# MC1000 工具VS2005 WindowsCE4.2 部署成功后提示“无法加载CLR...” 异或算法 BindingSource绑定数据 求个网站实例 在文档中,如何用正则表达式将字符串中的类似子字符串“092-007街道210SSp.4159”都提出来 超级高分征集解决方案,每题1000分,共5题目。 关于使用ListView 求个winfrom 的httpserver的例子 如何点击一个按钮打开一个窗口的同时将现有窗体关闭 水晶报表 120,紧急求助,WP,“NullReferenceException”异常
先弄明白如何画正弦曲线吧
{
DrawSin(e.Graphics);
} private void DrawSin(Graphics g)
{
Pen p = new Pen(Color.Black, 1);
int Zoom = 10; //放大倍数
Point center = new Point(100, 100); //原点 float x1 = (float)(0 * Math.PI * Zoom / 180 + center.X);
float y1 = (float)(Math.Sin(0 * Math.PI / 180) * Zoom + center.Y); g.DrawLine(p, 0, center.Y, 1000, center.Y); //x坐标轴
g.DrawLine(p, center.X, 0, center.X , 1000); //y坐标轴 for (int i = 1; i < 360*5; i++) //角
{
float x2 = (float)(i * Math.PI * Zoom / 180 + center.X);
float y2 = (float)Math.Sin(i * Math.PI / 180) *(-1) * Zoom+center.Y;
g.DrawLine(p, x1, y1, x2, y2); x1 = x2;
y1 = y2; }
}