SIGGRAPH07coursenotes least squares a good material. you can get the best description about least squares