10416 - Folding My T-Shirt
Posted: Tue Nov 26, 2002 4:46 pm
I always get wrong answer ...
What i do is this....
1) I obtain only the corner points. For this i take 3 points at a time (continuos) and check the area of the triangle formed... if it is 0 i remove the middle point... i do this for all the points until i am left only with the points which are corners
2) Next i pick all possible combinations of pairs of points and get an axis of symmetry and use the mid point of these two points...
using this vector and the point i check to see if all other points have an image using this as the axis of symmetry . If such a pair exists. i break out and say "Yes". If not "No"
I really dont know whats wrong..
Please Help
Any test data that could fail my program ?
What i do is this....
1) I obtain only the corner points. For this i take 3 points at a time (continuos) and check the area of the triangle formed... if it is 0 i remove the middle point... i do this for all the points until i am left only with the points which are corners
2) Next i pick all possible combinations of pairs of points and get an axis of symmetry and use the mid point of these two points...
using this vector and the point i check to see if all other points have an image using this as the axis of symmetry . If such a pair exists. i break out and say "Yes". If not "No"
I really dont know whats wrong..
Please Help
Any test data that could fail my program ?