! Find minimum circle radius that encloses
a set of points in 2space;
! Keywords: Circle, Circumscribe, Hull, Second order cone;
SETS:
POINT: x, y;
ENDSETS DATA:
! These happen to be corner points of a maximum area polygon for which
the distance between any pair is <= 1;
x = 0.4514926 0.2357990 0.1126499 0.4473675 0.5421421 0.000000;
y = 0.4561146 0.9718018 0.9936347 0.8943502 0.3434647 0.000000;
ENDDATA
! Variables:
x0 = x coordinate of the center of enclosing circle,
y0 = y coordinate of the center of enclosing circle
R = radius of circle;
! Minimize the radius;
MIN = R;
@FREE( x0); @FREE( y0);
! Each point must be distance <= r from center of circle.
This happens to be a second order cone constraint;
@FOR( POINT(i):
( x(i)  x0)^2 + ( y(i)  y0)^2 <= r^2;
);
