Hi, I am new to R, and am trying to solve the following optimization problem: This is a nonlinear least squares problem. I have a set of 3D voxels. All I need is to find a least squares fit to this data. The data model actually represent a cube-like structure, consisting of seven straight lines. The lines have some intersections (and at this intersection both of the participating lines end). Please note that I need something (some routines, maybe) that works for 3D voxels, and to which I can feed my problem directly (ie, not feeding the line equations separately, but together, since I have some line intersection constraints). (In case you need more detailed description of the problem, please view the link http://sites.google.com/site/niazarifin/matlab-project-images You'd also find a model image there.) Thanks for your patience! Any help would be greatly appreciated. An image of my model: http://www.nabble.com/file/p18989155/arif_frame.jpg -- View this message in context: http://www.nabble.com/3D-constrained-nonlinear-least-squares-fit-tp18989155p18989155.html Sent from the R help mailing list archive at Nabble.com.