# What's the efficient method to find the farthest vertex from centroid

Say I have a arbitrary convex polygon, what I wonder is the longest length from its centroid to its vertex, and which vertex it is.

I've looked it up on Wikipedia finding that I have to calculate its area firstly, then there's a formula determine the coordinates of centroid. I can then calculate all the lengths. Is there any other way faster?

• Is your polygon regular? How may sides does it have? Could you show us it's form? – Guilherme Thompson Dec 16 '15 at 13:09

The double of the oriented area of such an individual triangle is $A_i=v_{i,x}v_{i+1,y}-v_{i,y}v_{i+1,x}.$ You will also need the individual $A_i,$ not just their sum, in your formula for the centroid.
The centroid of an individual triangle is also easily computed as (two thirds of) $v_i+v_{i+1}.$
This means that your computation has to loop through the vertices once to calculate the $x$ and $y$ coordinates of the centroid of the polygon, and one more time to find the vertex (or vertices) with minimal distance.