proc float getdis(string $a, string $b){ float $tx = `getAttr ($a+".tx")` ; float $ty = `getAttr ($a+".ty")` ; float $tz = `getAttr ($a+".tz")` ; float $tx2 = `getAttr ($b+".tx")` ; float $ty2 = `getAttr ($b+".ty")` ; float $tz2 = `getAttr ($b+".tz")` ; $txx = $tx2 - $tx; $tyy = $ty2 - $ty; $tzz = $tz2 - $tz; float $lis = `sqrt($txx*$txx + $tyy*$tyy +$tzz*$tzz)`; return $lis ; } string $obj[] = `ls -sl`; float $dis = getdis($obj[0],$obj[1]);
转载于:https://www.cnblogs.com/ladaojeifang/archive/2013/03/02/2939818.html