Bob lost1 Alice's precious grand piano. Big mistake. Alice has now stolen Bob's low-orbit ion cannon.
Alice refuses to just make up with Bob, so let's help her give him a light tap on the roof. Suppose that from the top Bob's house looks like a lattice polygon, where all points have integer coordinates...
1. So he says.
Input: an \$n\times2\$ matrix of integers (where \$3\leq n\leq16\$) representing the coordinates of the points of an \$n\$-gon, given in the order in which you would join them up. To be absolutely clear, the first and second values in each of the \$n\$ rows are respectively an \$x\$- and a \$y\$-coordinate.
- If it would be far more natural to take something other than a 2D matrix in your language or it's impossible to take one, you can use something else. Should this happen, please clearly state what you're doing.
- \$x\$-coordinates or \$y\$-coordinates may be negative, zero or positive.
- The polygon formed by joining up the points in the given order may be convex or concave.
- There's no need to consider degenerate polygons.
- No input polygon will be self-intersecting, thank goodness.
Output: two numbers of any numeric type, respectively representing the \$x\$-coordinate and \$y\$-coordinate of a point within the polygon.
- No, your numbers needn't be integers.
- Your output needn't be consistent for any single input. You're allowed to generate an output in any valid way that shortens your code.
- Corners and edge points are forbidden. Sorry.
0 0 3 0 3 4
-3 -1 0 1 -1 -1 -1 0