- #1
Cbas
- 4
- 0
I have a group of 8 3-D points which all sit on an arbitrary plane
(The points were generated by projecting the corners of a axis aligned cube, box, onto the plane)
I wish to group all the points in a rectangle with the smallest surface area - so a tight fit rectangle.
What I am doing at the moment is:
1. transforming the plane (and thus all the points) to be parallel with the x-,y-plane (The z-axis points to the zenith). Thus each point is now described by only an (x,y) value (as they all have the same z value)
2. Fitting a rectangle now is trivial as I just find the smallest and largest (x,y) values and these make the lower left and upper right corners of my rectangle respectively
3. Transform the corners of the rectangle back to the plane.
Is there faster way of doing this (I am programming this so I favour speed)
Thank you very much
(The points were generated by projecting the corners of a axis aligned cube, box, onto the plane)
I wish to group all the points in a rectangle with the smallest surface area - so a tight fit rectangle.
What I am doing at the moment is:
1. transforming the plane (and thus all the points) to be parallel with the x-,y-plane (The z-axis points to the zenith). Thus each point is now described by only an (x,y) value (as they all have the same z value)
2. Fitting a rectangle now is trivial as I just find the smallest and largest (x,y) values and these make the lower left and upper right corners of my rectangle respectively
3. Transform the corners of the rectangle back to the plane.
Is there faster way of doing this (I am programming this so I favour speed)
Thank you very much