Add polygon perimeter drawing

Again, the input is x, y, the output r, c