I'm looking for a generic algorithm for creating a new XYZRxRyRz coordinate system within a larger "World" coordinate system, by findingpoints on the edges of the new coordinate system. I *think* I could puzzle out the math eventually, but I'm sure there are smarter people who have done this before. The general concept is this: I use a sensor to find three (or more) points on the edges of an object (let's assume it's a flat square, for the sake of simplicity) -- two points on one edge, one point on an adjoining edge. I have 3D data for each point, in terms of the World coordinate system. What I want to generate from that data is a single 6DOF data set that defines where the origin of the new coordinate system lies within the World coordinate system (XYZ), and how this subsidiary coordinate system is skewed relative to the World (RxRyRz). Working code examples, web pages, even books that explain the process well, they're all good.