Finding $3$D Lines passing through $3$D Points, all sharing a single Common Point

39 Views Asked by At

I'm writing a track finding algorithm, which finds the $3$d line going through a set of $3$d points such that the square distance for all points to that line is minimized.

I found this fantastic answer which solved this problem with a singular value decomposition very elegantly: https://stackoverflow.com/questions/2298390/fitting-a-line-in-3d. This is on a per-track basis, but I need another constraint: all tracks must come from the same point. If I knew this point, I could simply add it to all tracks and use the SVD solution, but I don't have that information.

Is there a more elegant solution that fits multiple tracks to multiple point clouds (the correlation which points belong to a tracks is known) while also having all tracks go though a single point? I'm writing this algorithm in python/numpy, if that is relevant.

Thank you in advance!