i come from a c++builder enviroment and i was convinced to try C# so i tried to rewrite a simple old program from c++ to c#. that's what i've done so far..it compiles perfectly but does not work at all!!
private void button1_Click(object sender, System.EventArgs e)
{
double xz = Convert.ToDouble(textBox1.Text);
double yz = Convert.ToDouble(textBox2.Text);
double yx = Convert.ToDouble(textBox3.Text);
double xx = Convert.ToDouble(textBox4.Text);
double yy = Convert.ToDouble(textBox5.Text);
double xy = Convert.ToDouble(textBox6.Text);
double dxxz,dxyz,dyxz,dyyz, b1, b2,x0, y0, c, lx,ly, lz;
dxxz = xx - xz;
dxyz = xy - xz;
dyxz = yx - yz;
dyyz = yy - yz;
b1 = yx * dyyz + xx * dxyz;
b2 = yy * dyxz + xy * dxxz;
x0 = (b1 * dyxz - b2 * dyyz)/(dyxz * dxyz + dyyz * dxxz);
y0 = (b1 * dxxz - b2 * dxyz)/(dyxz * dxyz + dyyz * dxxz);
c = Math.Sqrt(-(xx -x0) * (xy -x0) - (yx -y0) * (yy - y0));
lx = Math.Sqrt(Math.Pow(xx-x0,2)+ (yx - y0) + Math.Pow(c,2));
ly = Math.Sqrt(Math.Pow(xy-x0,2)+ (yy - y0) + Math.Pow(c,2));
lz = Math.Sqrt(Math.Pow(xz-x0,2)+ (yz - y0) + Math.Pow(c,2));
x0= Convert.ToDouble(label27.Text);
y0= Convert.ToDouble(label28.Text);
private void button1_Click(object sender, System.EventArgs e)
{
double xz = Convert.ToDouble(textBox1.Text);
double yz = Convert.ToDouble(textBox2.Text);
double yx = Convert.ToDouble(textBox3.Text);
double xx = Convert.ToDouble(textBox4.Text);
double yy = Convert.ToDouble(textBox5.Text);
double xy = Convert.ToDouble(textBox6.Text);
double dxxz,dxyz,dyxz,dyyz, b1, b2,x0, y0, c, lx,ly, lz;
dxxz = xx - xz;
dxyz = xy - xz;
dyxz = yx - yz;
dyyz = yy - yz;
b1 = yx * dyyz + xx * dxyz;
b2 = yy * dyxz + xy * dxxz;
x0 = (b1 * dyxz - b2 * dyyz)/(dyxz * dxyz + dyyz * dxxz);
y0 = (b1 * dxxz - b2 * dxyz)/(dyxz * dxyz + dyyz * dxxz);
c = Math.Sqrt(-(xx -x0) * (xy -x0) - (yx -y0) * (yy - y0));
lx = Math.Sqrt(Math.Pow(xx-x0,2)+ (yx - y0) + Math.Pow(c,2));
ly = Math.Sqrt(Math.Pow(xy-x0,2)+ (yy - y0) + Math.Pow(c,2));
lz = Math.Sqrt(Math.Pow(xz-x0,2)+ (yz - y0) + Math.Pow(c,2));
x0= Convert.ToDouble(label27.Text);
y0= Convert.ToDouble(label28.Text);