I found that this doesnt work for very small shapes. Because in the result, coordinates are rounded to 2 decimal places. So i kindly request you to add a parameter for decimal places which will support feet or meter accuracy.