="justify">}
}.csSystem;System.Collections.Generic;System.ComponentModel;System.Data;System.Drawing;System.Linq;System.Text;System.Windows.Forms;Курсач_2
{class Ball01
{public double x, y, r,, vy ,; Ball01 ()
{= 0; y=0; r=0.3;=0; vy=0; } Ball01 (
double m1, double r1, double x1, double y1, vx1, double vy1)
{= x1; y=y1; r=r1;=vx1; vy=vy1;=m1; } double M {get {return m; }} Rectangle G {
{new Rectangle (
(int) ((x - r) * Form1.km),
(int) ((y - r) * Form1.km),
(int) ((2 * r) * Form1.km),
(int) ((2 * r) * Form1.km));
}
} void Move (double dt, double fx, double fy)
{f=Math.Sqrt (fx * fx + fy * fy);
double v=Math.Sqrt (vx * vx + vy * vy); (v lt; 0.0001) {
{dvx=fx/m * dt; dvy=fy/m * dt;
x +=(vx + dvx/2) * dt; +=(vy + dvy/2) * dt; +=dvx; +=dvy;
}
} {(f gt; 0.0001)
{dvx=fx/m * dt; dvy=fy/m * dt; +=(vx + dvx/2) * dt; +=(vy + dvy/2) * dt;
vx +=dvx; +=dvy;
}
{
double dvx=fx/m * dt; dvy=fy/m * dt;
double dv=Math.Sqrt (dvx * dvx + dvy * dvy);
(dv gt;=v)
{vx=0.0; vy=0.0; return;
} +=(vx + dvx/2) * dt; +=(vy + dvy/2) * dt;
vx +=dvx; +=dvy;
}
}
} NewPoz (double dt, double fx, double fytraction_force)
{dvx=fx/m * dt; dvy=fy/m * dt; (! traction_force)
{v=Math.Sqrt (vx * vx + vy * vy);
//dv=Math.Sqrt (dvx * dvx + dvy * dvy);
(dv gt;=v)
{= 0.0; vy=0.0; ;
}
}
double dx=(vx + dvx/2) * dt; dy=(vy + dvy/2) * dt;
x +=dx; +=dy;
+=dvx; +=dvy; px, py, b_wall; void Show (Graphics g1, Brush b1)
{.FillEllipse (b1, G);
}
}
}.csSystem;System.Collections.Generic;System.ComponentModel;System.Data;System.Drawing;System.Linq;System.Text;System.Windows.Forms;Курсач_2
{class Ball02
{public double x, y, r,, vy ,;
public Ball02 ()
{= 0; y=0; r=0.3;=0; vy=0; } Ball02 (
double m1, double r1, double x1, double y1, vx1, double vy1)
{= x1; y=y1; r=r1;=vx1; vy=vy1;=m1; } double M {get {return m; }} Rectangle G {
{new Rectangle (
(int) ((x - r) * Form1.km),
(int) ((y - r) * Form1.km),
(int) ((2 * r) * Form1.km),
(int) ((2 * r) * Form1.km));
}
} void Move (double dt, double fx, double fy)
{f=Math.Sqrt (fx * fx + fy * fy);
double v=Math.Sqrt (vx * vx + vy * vy); (v lt; 0.0001) {
{dvx=fx/m * dt; dvy=fy/m * dt;
x +=(vx + dvx/2) * dt; +=(vy + dvy/2) * dt; +=dvx; +=dvy;
}
} {(f gt; 0.0001)
{dvx=fx/m * dt; dvy=fy/m * dt; +=(vx + dvx/2) * dt; +=(vy + dvy/2) * dt;
vx +=dvx; +=dvy;
}
{
double dvx=fx/m * dt; dvy=fy/m * dt;
double dv=Math.Sqrt (dvx * dvx + dvy * dvy); (dv gt;=v)
{vx=0.0; vy=0.0; return;
} +=(vx + dvx/2) * dt; +=(vy + dvy/2) * dt;
vx +=dvx; +=dvy;
}
}
} NewPoz (double dt, double fx, double fytraction_force)
{dvx=fx/m * dt; dvy=fy/m * dt;
(! traction_force)
{v=Math.Sqrt (vx * vx + vy * vy);
//dv=Math.Sqrt (dvx * dvx + dvy * dvy); (dv gt;=v)
{= 0.0; vy=0.0; ;
}
}
double dx=(vx + dvx/2) * dt; dy=(vy + dvy/2) * dt;
x +=dx; +=dy;
vx ...