curve decomposition into lines via recursive least squares