, Visual C#



37.1. Form1_Load.

// z = f(x, y):

double f1;

double f(double x, double y)

{

// z = f(x, y) :

double a = 1.03;

double b = 1.02;

double c = 1.01;

// z = f(x, y) :

f1 = Math.Sqrt(c * c * (200 - x * x / (a * a)

y * y / (b * b)));

return f1;

}

// :

myClassPoint3D myEye = new myClassPoint3D();

// :

const int x_max = 20;

const int y_max = 20;

const int x_min = -10;

const int y_min = -10;

// :

myClassPoint3D[,] Points = new myClassPoint3D[x_max + 1, y_max + 1];

// :

myClassPoint3D[] Axes = new myClassPoint3D[4];

// :

private void Form1_Load(object sender, EventArgs e)

{

// :

myEye = new myClassPoint3D(40, 20, 20);

// :

double x, y, z; int i, j;

// (i,j)- x,y

// z - z = f(x, y):

for (i = 0; i <= x_max; i++)

{

x = i + x_min;

for (j = 0; j <= y_max; j++)

{

y = j + y_min;

// z - z = f(x, y):

z = f(x, y);

Points[i, j] = new myClassPoint3D(x, y, z);

}

}

// (axes) :

Axes[0] = new myClassPoint3D(0, 0, 0);

Axes[1] = new myClassPoint3D(30, 0, 0);

Axes[2] = new myClassPoint3D(0, 30, 0);

Axes[3] = new myClassPoint3D(0, 0, 30);

}

PictureBox, Properties ( ) Events Paint. Form1.cs ( pictureBox1_Paint), .