4
$\begingroup$

I know how to fit a 2D line through a set of points but how can I fit a plane through a set of lines?

My lines are almost intersecting at a 3D point.

I am interested in suggestions for an a algorithmic approach to solve the problem, for example I know the least squares method for the 2D, is there any "equivalent" method for the 3D problem?

Thank you.

  • 0
    What do you mean to fit a plane? Should the plane contain all those lines? If yes, then the lines should be in the same plane. What do you mean by the lines almost intersecting? Two lines intersect, or are parallel or not in the same plane.2011-06-01
  • 1
    In 2D, one normally seeks to minimize the average 'vertical' distance (squared) from the points to the line. It's not clear, in your 3D case, what you'd like to minimize.2011-06-01

1 Answers 1

3

Least Squares (suitably modified) still works reasonably well here - write your plane equation in the form $\hat{n}\cdot \vec{P} = d$, with (the components of) the normal vector $\hat{n}$ and the 'distance-from-origin' $d$ as your four parameters, plug in each of your lines to see how close they are to being parallel to this plane, and then minimize suitably. Note that you'll need to use something like a Lagrange Multiplier to cover the constraint that $\hat{n}$ actually be a normal vector.