7 local $filename = shift;
11 || die "Cannot open $filename\n";
14 local @f = split(/\s+/, $_);
27 foreach my $i (sort keys %T) {
28 if (!defined $last_i) {
33 local $si = $last_i + 1;
35 $R{$si} = $T{$last_i} + ($si - $last_i) * ($T{$i} - $T{$last_i}) / ($i - $last_i);
46 local ($min_i, $max_i);
47 foreach my $i (@values) {
57 return ($min_i, $max_i);
60 local %BX = load_file
($ARGV[0]);
61 print STDERR
"X loaded\n";
62 local %BY = load_file
($ARGV[1]);
63 print STDERR
"Y loaded\n";
65 local %X = %BX; interpolate
(%BX);
66 local %Y = %BY; interpolate
(%BY);
68 local ($min_i, $max_i) = range
(keys %X);
69 local ($min_j, $max_j) = range
(keys %Y);
71 print STDERR
"RANGE[X] = $min_i, $max_i\n";
72 print STDERR
"RANGE[Y] = $min_j, $max_j\n";
75 foreach my $i (($min_i - $max_j)..($max_i - $min_j)) {
77 foreach my $j (-$max_j..-$min_j) {
80 if (defined $X{$i - $j}) {
83 if (defined $Y{-$j}) {
88 print $i, " ", $z, "\n";
92 print STDERR
"TOTAL = $total\n";