Help for this page

Select Code to Download


  1. or download this
    for $i (0 .. $npts-1) {
       for $j ($i+1 .. $npts-1) {
          $dx = $x[$j] - $x[$i];
    ...
          $fy[$j] -= $f * $dy / $d;
       }
    }
    
  2. or download this
    for $i (0 .. $npts-1) {
       $x[$i] += $dt * $fx[$i];
       $y[$i] += $dt * $fy[$i];
    }