subroutine kutl_vertex_average(z1, Vz1, z2, Vz2, z3, Vz3, chisq) * * begin_doc * * Find the weighted average of two 3-D vertices * * Input Parameters: * z1 double precision array * (x,y,z) of first vertex * * Vz1 double precision array * 3x3 covariance matrix of first vertex * * z2 double precision array * (x,y,z) of second vertex * * Vz2 double precision array * 3x3 covariance matrix of second vertex * * Output Parameters: * z3 double precision array * (x,y,z) of averaged vertex * * Vz3 double precision array * 3x3 covariance matrix of averaged vertex * * chisq double precision variable * chisquare of combined vertex * * Other routines: * * Notes: * * >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> * The solution is just a generalization of the formula for the weighted * sum of two scalers. It can be written, using a clever trick to reduce * the number of matrix inversions, as * * z = (Vz1(inv) + Vz2(inv))(inv) * (Vz1(inv)*z1 + Vz2(inv)*z2) * = z1 + Vz1 * [Vz1 + Vz2](inv) * (z2 - z1) * * The chisquare can be computed as (after some manipulation) * * chisq = (z2 - z1)(t) * [Vz1 + Vz2](inv) * (z2 - z1) * >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> * * Author: Paul Avery Created: Tue Sep 23 21:28:32 EDT 1997 * * Major revisions: * * * end_doc