Help for this page

Select Code to Download


  1. or download this
    @dist = map sqrt($x[$_]**2+$y[$_]**2+$z[$_]**2), 0..$#x;
  2. or download this
    @dist = map sqrt(($x[$_]-$x0)**2+($y[$_]-$y0)**2+($z[$_]-$z0)**2), 0..$#x;
  3. or download this
    @indices = sort {$dist[$a]<=>$dist[$b]} 0..$#dist;
    @dist = @dist[@indices];
    @x = @x[@indices];
    @y = @y[@indices];
    @z = @z[@indices];
    @name = @name[@incides];
    
  4. or download this
    for my $one (0..$#@dist-1) {
        my $two = $one;
        while (++$two < @dist && $dist[$two]-$dist[$one] <= $cutoff) {
    ...
                if sqrt(($x[$one]-$x[$two])**2+($y[$one]-$y[$two])**2+($z[
    +$one]-$z[$two])**2) <= $cutoff;
        }
    }