I don't quite see how we could optimize this much. `np.sum(v1 * v2)` is only computed once per loop, and within each loop the values of `v1` and `v2` vary depending on which `tri` it is. I thought about doing a (potentially huge) difference matrix as `diffs = fros[:, np.newaxis, :] - surf['rr'][np.newaxis, :, :]` or so, but I don't think those differences are the bottleneck here anyway.