Using Using Using Using Using Using Using Namespace Public Partial Class Public
Using Using Using Using Using Using Using Namespace Public Partial Class Public
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
//using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace Ecuatie
{
public partial class Form2 : Form
{
public Form2()
{
InitializeComponent();
}
private void label6_Click(object sender, EventArgs e)
{
}
private void Form2_Load(object sender, EventArgs e)
{
}
private void textBox6_TextChanged(object sender, EventArgs e)
{
}
private void textBox11_TextChanged(object sender, EventArgs e)
{
}
private void button2_Click(object sender, EventArgs e)
{
System.Drawing.Pen myPen;
PointF pp = new PointF();
pp.X = 200; pp.Y = 200;
myPen = new
System.Drawing.Pen(System.Drawing.Color.Empty);
if(textBox1.Text=="0")
myPen = new
System.Drawing.Pen(System.Drawing.Color.FromName("Control"));
if (textBox1.Text == "1") myPen = new
System.Drawing.Pen(System.Drawing.Color.Red);
System.Drawing.Graphics formGraphics =
this.CreateGraphics();
System.Drawing.Graphics formGraphics1 =
this.CreateGraphics();
double hx, xi, ai, bi, v;
int lx, rx, uy, ly, nvalx, npx, npy, i, j, k, n, m, xx1,
yy1, xx2, yy2; string s, s1;
double yma, ymi, fv, upx, upy, mx;
ai = Convert.ToDouble(Ai.Text); bi =
Convert.ToDouble(Bi.Text);
lx = Convert.ToInt32(LeftX.Text); rx =
Convert.ToInt32(RightX.Text);
uy = Convert.ToInt32(UpperY.Text); ly =
Convert.ToInt32(LowerY.Text);
npx = rx - lx; npy = ly - uy; nvalx =
Convert.ToInt32(Nvalx.Text);
s = ""; s1 = ""; s = FFun.Text; s.Replace(" ", ""); k =
s.IndexOf("(");
s1 = s.Substring(1, k - 1); FFunR.Text = s1;
hx = (bi - ai) / nvalx; mx = Convert.ToDouble(mmx.Text);
yma = 0; ymi = 0;
for (i = 0; i < nvalx; i++)
{
v = Convert.ToDouble(i); xi = ai + (v - 1) * hx; fv =
Math.Sin(mx * xi);
if (yma < fv) yma = fv; if (ymi > fv) ymi = fv;
}
Ymin.Text = ymi.ToString(); Ymax.Text = yma.ToString();
}
private void button1_Click(object sender, EventArgs e)
{
}
private void button3_Click(object sender, EventArgs e)
{
}
}