Problem definition says:
"The first line of input will contain a single integer n specifying the number of points along the outline of the side view of the boat. The following n lines will each contain two integers: the x and y coordinate of a point along the outline. The points will be given in ...
Search found 5 matches
- Wed Jul 09, 2008 10:54 am
- Forum: Volume 114 (11400-11499)
- Topic: 11460 - Balance
- Replies: 9
- Views: 2533
- Thu Jun 26, 2008 2:10 pm
- Forum: Volume 114 (11400-11499)
- Topic: 11460 - Balance
- Replies: 9
- Views: 2533
Re: 11460 - Balance
in this page:
http://local.wasp.uwa.edu.au/~pbourke/g ... /polyarea/
you can find some sample codes.
according to my calculations test case is correct.
http://local.wasp.uwa.edu.au/~pbourke/g ... /polyarea/
you can find some sample codes.
according to my calculations test case is correct.
- Thu Jun 26, 2008 12:24 pm
- Forum: Volume 114 (11400-11499)
- Topic: 11460 - Balance
- Replies: 9
- Views: 2533
Re: 11460 - Balance
as i wrote before since there are two polygon sets we have to add extra points (on wich points the x-axis crossed) to these two polygons.
so the polygons must be:
CE: (0, 0) , (0, 1), (2, 3), (4, 1), (4, 0) x-coord of centroid is 2
CLR: (4, 0) , (4, -3), (2, -3), (2, -1), (0, -1), (0, 0) x-coord of ...
so the polygons must be:
CE: (0, 0) , (0, 1), (2, 3), (4, 1), (4, 0) x-coord of centroid is 2
CLR: (4, 0) , (4, -3), (2, -3), (2, -1), (0, -1), (0, 0) x-coord of ...
- Wed Jun 25, 2008 8:15 pm
- Forum: Volume 114 (11400-11499)
- Topic: 11460 - Balance
- Replies: 9
- Views: 2533
Re: 11460 - Balance
i figured out as:
first make two polygon set as above and below the x-axis.
second add the points to these polygons at which points original big polygon crosses the x-axis.
third find the centroids of these polygons.
finally find the diff. between x coordinates of two centroids.
the important ...
first make two polygon set as above and below the x-axis.
second add the points to these polygons at which points original big polygon crosses the x-axis.
third find the centroids of these polygons.
finally find the diff. between x coordinates of two centroids.
the important ...
- Wed Jun 25, 2008 10:58 am
- Forum: Volume 114 (11400-11499)
- Topic: 11460 - Balance
- Replies: 9
- Views: 2533
11460 - Balance
do i have to implement centroid of a polygon algorithm from formula like in http://en.wikipedia.org/wiki/Centroid
or is there a simple way that i couldnt figure it out yet
...any idea?
or is there a simple way that i couldnt figure it out yet
