The center of thrust is effectively the weighted average of all the thrust locations. The weighting for each location is proportional to how much the thrust from that location contributes to the overall thrust. That is simply the dot product of the thrust from the specific location to the total thrust.
For example, if you have 5 engines with each producing a thrust of (0, 0, 10), then the total thrust is (0, 0, 50). The dot product of each individual thrust with the total thrust is the same (500), so the location of each individual thrust is weighted equally in the final location "average".
Each individual weight is the individual dot product, divided by the total of all the dot products. In the above example, each dot product is 500, and the total is 2500. In this case of five identical engines pointing in identical directions, the individual weights of each thrust location are 500/2500 = 1/5, which is the same as a straight average.
Note that this method correctly ignores thrust that is perpendicular to the total thrust. Suppose the above example included two small engines with thrusts of (2, 0, 0) and (-2, 0, 0). Intuitively you can see that their thrusts cancel out. Mathematically, their dot products with the total thrust are 0, so their locations are averaged into the total with 0 weight, meaning they are ignored.