I am trying to solve the problem for my assignment that have polygon Q as input and outputs polygon P such that 2D coordinate points of Q are midpoints of the polygon P.