Polygon vertices coordinates

Is it possible to find out the coordinates of the vertices of a polygon? I tried calculating the centroid of the polygon but it seems my calculation didn’t agree with corona’s, how does Corona calculate the centroid of a polygon? I used the formula from wikipedia http://en.wikipedia.org/wiki/Centroid#Centroid_of_polygon.

Or in other words, how can I draw a triangle with vertices at (200,200),(300,500),(100,400) using display.newPolygon?

“center” in this context just means the center of the bounding box (which would be 200,350)

Ah, of course. For some reason I thought the center was the centroid. Thanks alot, it works perfectly now.

Or in other words, how can I draw a triangle with vertices at (200,200),(300,500),(100,400) using display.newPolygon?

“center” in this context just means the center of the bounding box (which would be 200,350)

Ah, of course. For some reason I thought the center was the centroid. Thanks alot, it works perfectly now.