Пример #1
0
 public static double Distance(this Space space, int a, int b) => Sum(space.Axis, i => Math.Pow(space.Particles.Position[a, i] - space.Particles.Position[b, i], 2));
Пример #2
0
 public static double Force(this Space space, int a, int b) => space.Charge(a, b) / space.Distance(a, b);
Пример #3
0
 public static double Charge(this Space space, int a, int b) => Mul(space.Charges, i => space.Particles.Charge[a, i] * space.Particles.Charge[b, i]);
Пример #4
0
 public static double Force(this Space space, int a) => space.Charge(a) / space.Distance(a);