11066 - Aragorn
Posted: Fri Aug 18, 2006 5:17 pm
Hi, as far as i understand this problem is about concave polygon intersection ( or may be i should say, polygon clipping) or atleast i am trying to do so.
i managed to code it up according to some algorithm available. bad luck! i got wrong answer. the algorithm i am using gives approximate answer when there are vertices on the edge of other polygon. but it shouldn't be effecting much in case of area calculation.
all the simple hand made data passed out. and it is difficult to check big cases by hand. so i need some help. i am not sure is it all about precision error or anything else.
someone please help me to check my code.
is the following I/O correct?
Input:
Output:
Can i get some more data?
thanks a lot...
i managed to code it up according to some algorithm available. bad luck! i got wrong answer. the algorithm i am using gives approximate answer when there are vertices on the edge of other polygon. but it shouldn't be effecting much in case of area calculation.
all the simple hand made data passed out. and it is difficult to check big cases by hand. so i need some help. i am not sure is it all about precision error or anything else.
someone please help me to check my code.
is the following I/O correct?
Input:
Code: Select all
2
0 0
100 0
2
0 0
100 0
2
0 10
100 10
2
0 15
100 15
3
0 100
50 50
100 100
2
0 50
100 50
3
0 100
50 50
100 100
2
0 51
100 51
3
0 0
10000 10000
20000 0
2
0 10000
20000 10000
5
1 7
3 11
4 5
5 11
7 7
5
0 1
2 11
4 7
6 11
8 1
2
0 0
10000 0
3
0 0
5000 5000
10000 0
7
0 6
3 4
1 1
4 3
7 1
5 4
8 6
5
0 4
3 3
4 0
5 3
8 4
0
Code: Select all
0.00
333.33
0.00
1.00
33333200.00
3.33
24999975.00
2.91
thanks a lot...