Polygon/Ellipse Intersection ---------------------------- You have been asked to compute the area of the inter- section of a convex polygon and an ellipse. For simplicity, the ellipse is positioned so its major semi-axis, which is of length A, is on the x-axis, and its minor semi-axis, which is of length B, is on the y-axis. Input ----- For each of several test cases, first a line containing just the test case name, then a line containing A B N where N is the number of vertices in the polygon, and then N lines each containing X Y specifying that (X,Y) is a vertex. The vertices are listed in clockwise order. N is an integer, all other numbers are floating point. 3 <= N <= 100 0 < B <= A <= 100 -100 <= X,Y <= 100 Input ends with an end of file. Output ------ For each test case, first a line containing the test case name, and then a line containing just the required area, printed with exactly 3 decimal places. Sample Input ------ ----- -- SAMPLE 1 -- 4 1 3 0 0 0 2 8 0 -- SAMPLE 2 -- 50 8 3 0 0 100 16 100 -16 -- SAMPLE 3 -- 1 1 3 1 1 1 2 2 1 -- SAMPLE 4 -- 100 100 4 -100 -100 -100 +100 +100 +100 +100 -100 -- SAMPLE 5 -- 1 1 3 0 0 -0.7071067700 +0.7071067700 +0.7071067700 +0.7071067700 Sample Output ------ ------ -- SAMPLE 1 -- 3.142 -- SAMPLE 2 -- 314.159 -- SAMPLE 3 -- 0.000 -- SAMPLE 4 -- 31415.927 -- SAMPLE 5 -- 0.500 File: polyellipse.txt Author: Bob Walton Date: Mon Oct 14 15:26:41 EDT 2013 The authors have placed this file in the public domain; they make no warranty and accept no liability for this file. RCS Info (may not be true date or author): $Author: walton $ $Date: 2013/10/14 19:27:17 $ $RCSfile: polyellipse.txt,v $ $Revision: 1.8 $