Fitting straight lines and planes with an application to radiometric dating