How to find square inscribed in ellipse sector?

88 Views Asked by At

enter image description here

There is the sector ABC of the sloped ellipse. The center of ellipse is in point A.

I know all sector's parameters - minor and major axes a and b, ellipse slope angle, ellipse center coordinates. I also know coordinates of sector's points - A, B and C.

I'm struggling how to find the largest not sloped square DEFG (it's coordinates) inside this sector. Could anybody help me or give any hint?

1

There are 1 best solutions below

0
On

The space of all squares can be parametrized by a corner and it’s size (3 real variables). The set of permissible squares is compact, so the maximal square exists.

If the sector only goes through zero or one corner of the square, you can expand it, so it’s not maximal.

Two corners and either the points of tangency are parallel or at a corner, or you can expand it by moving parrallel to one of the range cues. There’s a finite number of corners or points on the arc whose tangent lines are parallel to the other bounding lines. Expanding from those points let’s you construct the square.

Otherwise 3 or 4 corners are touching. This would define several quadratic equations which give a unique solution.

The actual casework and solving 3 degree 2 equations in 3 variables is possible but messy.

It’s much easier to code up a test if the square is inside the ellipse and then just try every possible square, increasing precision in on the largest ones.