Calculating the IR target z

If I have the ASPD sensor locations, I can use

BEGIN{targetRad=7186.59;}
{
  pt=$1;x1=$5;y1=$6;z1=$7;
  x2=$12;y2=$13;z2=$14;
  r1=sqrt(x1*x1+y1*y1);
  r2=sqrt(x2*x2+y2*y2);
  alpha=(z1-z2)/(r1-r2);
  beta=z1-alpha*r1;
  print pt,alpha*targetRad+beta;
}

operating on a file like this which contains top and bottom ASPD X/Y/Z:

Top 15,6732.14,1793.55,6671.21,6732.14,1793.55,6669.69, Bot 15,4278.84,1141.62,6661.98,4278.84,1141.62,6660.45,
Top 75,1803.17,6715.97,6660.71,1803.18,6715.97,6659.19, Bot 75,1146.43,4263.91,6663.01,1146.43,4263.91,6661.48,
Top 135,-4920.55,4913.20,6662.26,-4920.55,4913.20,6660.72, Bot 135,-3121.50,3121.65,6665.55,-3121.49,3121.65,6664.01,
Top 195,-6722.44,-1805.62,6665.27,-6722.44,-1805.61,6663.71, Bot 195,-4271.77,-1141.96,6665.30,-4271.77,-1141.96,6663.74,
Top 255,-1798.24,-6720.23,6671.90,-1798.24,-6720.23,6670.34, Bot 255,-1144.99,-4267.18,6672.20,-1145.00,-4267.18,6670.65,
Top 315,4926.61,-4919.66,6675.06,4926.60,-4919.66,6673.52, Bot 315,3129.45,-3126.34,6668.40,3129.45,-3126.34,6666.86,

My MAB center is something like: (5030.605, -5252.996, 6671.73), with the target set at (0,0,33.14) with respect to it: ie my MAB center is the target position!


If what I have is the MAB center, I need to correct the Z somewhat.