in reply to Subroutine not correct (I think)
I am not really understand what would you like to do with your input data. But I can point out two things.
printf has three format specifier and five values.
printf OUT "%s to %s Distance=%.5f\n", $data[$i][0], $data[$j][0], $data[$i][2], $data[$j][2], distance(\@coords_i, \@coords_j);
($x - $x), ($y - $y) and ($z - $z) are always equal to zero.
return sqrt(($x - $x)**2 + ($y - $y)**2 + ($z - $z)**2);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Subroutine not correct (I think)
by jcklasseter (Sexton) on Jun 17, 2015 at 13:11 UTC | |
by pme (Monsignor) on Jun 17, 2015 at 13:31 UTC | |
by jcklasseter (Sexton) on Jun 17, 2015 at 13:38 UTC | |
by roboticus (Chancellor) on Jun 17, 2015 at 13:43 UTC | |
by locked_user sundialsvc4 (Abbot) on Jun 17, 2015 at 13:18 UTC | |
by jcklasseter (Sexton) on Jun 17, 2015 at 13:25 UTC |