Sorry, but this is not specific enough. It's not clear what the program is supposed to do. What are the inputs? What are the outputs? What "set of vertices" need to be found for what polygon. There are infinite number of polygons. Do you want a set of (x, y) coordinates, or (x, y, z) that are in the same plane?
Again, it's really not clear what you're after.
It's also better if you post the problem (the task) description in details then your attempt to solve it (the code you wrote).