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); }
public static double Force(this Space space, int a, int b) => space.Charge(a, b) / space.Distance(a, b);
public static double Force(this Space space, int a) => space.Charge(a) / space.Distance(a);