Radius of the largest circle in an irregular convex polygon by utilizing the Chebyshev center

663 Views Asked by At

I am trying to find the largest circle within the polygon with corners (0, 1), (0, 6), (4, 10), (8, 10), (11, 7), (11, 4), (7, 0), and (1, 0). So far I have drawn out this polygon and defined its convex set as $\boldsymbol(x) \in \mathbb{R}^2 \vert A\boldsymbol(x) \leq b$, with

$A = \begin{bmatrix} 1 & 0 \\ 0 & 1 \\ -1 & 1 \\ 1 & -1 \\ -1 & -1 \\ 1 & 1 \end{bmatrix}$ $b = \begin{bmatrix} 11 \\ 10 \\ 6 \\7 \\ -1 \\ 18 \end{bmatrix}$

My CVX code is as follows,

A = [1 0;0 1;-1 1;1 -1;-1 -1;1 1];
b = [11; 10; 6; 7; -1; 18];
cvx_begin quiet
    variables r x(2);
    min -r;
    subject to
        for i = 1:6
            A(i,:)*x + r*norm(A(i,:)) <= b(i);
        end
        x >= 0;
        r >= 0;
cvx_end
r, x

I think I get a correct value for $\boldsymbol{x} = (5.1503, 4.6998)$ but my radius way too small at $r = 0.3431$. I feel like I'm missing something obvious.