This post explains how to make linear approximation with a simple example. Let’s assume we want to approximate a point cloud with a linear function :
.
The point cloud is given by
points with coordinates
. The aim is to estimate
and
where
will fit the point cloud as mush as possible. We want to minimize for each point
the difference between
and
, ie. we want to minimize
. The matrix form of the system is given by:
Let’s define ,
and
:
The system is now given by:
The optimal solution is given by:
Where is the pseudoinverse of
given by
.
Donwload

Least square approximation example 0.56 KB