yeah it works for any polygon and the vertices should be in order either from 1st to last or opposite
yeah it works for any polygon and the vertices should be in order either from 1st to last or opposite