این برنامه سینوس رو رسم میکنه بقیه توابع هم به همین صورت هستش
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace WindowsFormsApplication46
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private PictureBox pictureBox1 = new PictureBox();
private void Form1_Load(object sender, EventArgs e)
{
pictureBox1.Dock = DockStyle.Fill;
pictureBox1.BackColor = Color.White;
pictureBox1.Paint+=new PaintEventHandler(pictureBox1_Paint);
this.Controls.Add(pictureBox1);
}
private void pictureBox1_Paint(object sender, PaintEventArgs e)
{
Graphics g = e.Graphics;
g.DrawLine(Pens.Black, 0, this.Size.Height / 2.0f, this.Size.Width, this.Size.Height / 2);
g.DrawLine(Pens.Black, this.Size.Width / 2, 0.0f, this.Size.Width / 2, this.Size.Height);
float xZarib = 70;
float yZarib = 200;
float beginX = (float)(-2 * xZarib / 2 * Math.PI);
float endX = (float)(2 * xZarib / 2 * Math.PI);
float offsetX = this.Size.Width / 2;
float offsetY = this.Size.Height / 2;
for (float x = beginX; x <= endX; x += 0.1f)
{
float y = (float)(System.Math.Sin(x / xZarib) * yZarib);
g.DrawRectangle(System.Drawing.Pens.Red, x + offsetX, -y + offsetY, 1.1f, 1.1f);
}
}
}
}