Constructed axis in space XYZ. if you look perpendicular to the z axis (I have it directed to the screen plane), then the axis is plotted according to the graph y = x;

Rutherford's atom model

If you look at an angle, you can see that this is an orbit.

model at an angle

Built the orbit (axis) according to the following algorithm

public void Draw(TransformMatrix transform2) { TPoint buf5 = new TPoint(); for (int l = 0; l < 180; l ++) { buf5.setX(270 * Math.Cos(45) * Math.Cos(l) + 350); buf5.setZ(270 * Math.Sin(l)); buf5.setY(-270 * Math.Cos(45) * Math.Cos(l) + 350); TPoint _p5 = buf5.ToView(transform2); zbuffer.setColor(_p5.getIntX(), _p5.getIntY(), Color.FromArgb((int)(_p5.getColor().R * 1), (int) (_p5.getColor().G * 0), (int)(_p5.getColor().B * 1))); } } 

where ToView (transform2) displays a point in 3D in 2D.

 public TPoint ToView(TransformMatrix view) { TPoint vp = new TPoint(); vp.setX(x * view.matrix[0, 0] + y * view.matrix[1, 0] + z * view.matrix[2, 0] + view.matrix[3, 0]); vp.setY(x * view.matrix[0, 1] + y * view.matrix[1, 1] + z * view.matrix[2, 1] + view.matrix[3, 1]); vp.setZ(x * view.matrix[0, 2] + y * view.matrix[1, 2] + z * view.matrix[2, 2] + view.matrix[3, 2]); return vp; } 

In this orbit, my sphere rotates (it is an electron). But the problem is that it rotates not in a circle (ie, not in orbit) but in some kind of ellipse. I do not understand what's the matter. I rotate it as follows.

 public double [,] matrix = { {1, 0, 0, 0}, {0, 1, 0, 0}, {0, 0, 1, 0}, {0, 0, 0, 1} }; public void RotateXY(double angle) { mult_matrix(RotationX(angle)); mult_matrix(RotationY(angle)); } public double[,] RotationX(double angle) { double[,] buf = { {1, 0, 0, 0}, {0, Math.Cos(angle), Math.Sin(angle), 0}, {0, -Math.Sin(angle), Math.Cos(angle), 0}, {0, 0, 0, 1} }; return buf; } public double[,] RotationY(double angle) { double[,] buf = { {Math.Cos(angle), 0, -Math.Sin(angle), 0}, {0, 1, 0, 0}, {Math.Sin(angle), 0, Math.Cos(angle), 0}, {0, 0, 0, 1} }; return buf; } private void mult_matrix(double[,] transform) { double [,] buf = new double [4,4]; for (int i = 0; i < 4; i++) for (int j = 0; j < 4; j++) { buf[i, j] = 0; for (int k = 0; k < 4; k++) buf[i, j] += matrix[i, k] * transform[k,j]; } matrix = buf; } 

those. I use transition matrices. But somewhere in this transformation I have a mistake. Thank.

    0