I\'ve spent a decent amount of time trying to hunt down a simple way of doing this - ideally, a magical library exists out there somewhere that will take my set of 3D data p
Google for "java linear least squares regression library" and you should find a few options. One is Drej. I have not used this myself, though.
EDIT - I'm not confident this answers the question - I don't know whether 3D data is supported.