[Math] Find longest segment through centroid of 2D convex polygon

computational geometry

Given a 2D convex polygon P and its centroid C, how do I find the longest line segment passing through C, where the endpoints of the segment lie on the boundary of P?

Intuitively I imagine there are only a small number of possibilities, so I could just compute the lengths of each of those line segments and see which is longest. For instance, I might check each such line segment passing through C where at least one endpoint is a vertex of P.

Background: I would like simulate an epithelial tissue represented as a collection of Voronoi cells. Per http://dash.harvard.edu/bitstream/handle/1/4731601/Gibson_Control_Mitotic.pdf the mitotic cleavage plane during cell division lies along the "long axis", which I define above as the line segment I would like to find.

Best Answer

Your intuition is right: you only have to check the line segments through vertices. (Proof: the distance from a fixed point to a moving point on a line is a convex function of this moving point). This is also true for line segments passing through any other fixed point inside, it does not have to be the centroid. In general, this cannot be improved, unless you have some additional information about your polygon.

Related Question