I need to find the largest isosceles trapezium inscribed inside a polygon, and the trapezium must have a set center.
The polygon is defined by an array of points in 2D. The polygon is closed and it can be convex or concave.
By isosceles trapezium I mean this shape.
Which is a quadrilateral with two parallel sides and one line of symmetry.
Center can mean many things, for this problem the center is the following
That is, the point where perpendicular line at the middle of the base meets the perpedincular line at the middle of the height.
I tried reading the algorithms to find out the biggest rectangle inscribed in a polygon, and adapting them, but they don’t seem to be very flexible.