I am given $N$ plane equations in the $ax+by+cz+d=0$ form, meaning we have their normals $a, b, c: ||(a, b, c)|| = 1$ and distances from the origin ($d$). In general, the planes are similar, so the coefficients do not differ very much. I do not have any points on the given planes, but I guess they can be sampled.
I need to find an equation of the plane which is closest to them all, i.e represents the cluster of the planes in the best way. To put it differently, I need to merge all the planes into one. I am not sure what metric to use to measure plane fitness.
I've tried taking average of all plane coefficients, which produces a good result of the normal, but the last coefficient ($d$) seems wrong, the resulting plane has a small offset from the cluster.