Пример #1
0
        public static double[,] Distance(this Space space, Segment sa, Segment sb)
        {
            var result = new double[sa.Length, sb.Length];

            for (var a = 0; a < sa.Length; a++)
            {
                for (var b = 0; b < sb.Length; b++)
                {
                    result[a, b] = space.Distance(sa.Offset + a, sb.Offset + b);
                }
            }
            return(result);
        }
Пример #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 Force(this Space space, int a) => space.Charge(a) / space.Distance(a);