This site aims to be the ultimate resource for Adobe Illustrator(c) scripting. Here you will find regularly updated collection of scripts for all your creative needs.
If you find yourself doing the same task again and again, or you have an idea how to optimise your  workflow – get in touch, and we will provide solution.

Circumcircle

Draws circumcircles for each selected path.

Method:
The major reason why this script was written was to draw a “circumcircle” for a star.
So the method to find the center and the radius for the circumcircle is rather incertitude.

  1. find out a perpendicular bisector for the line connecting 1st and 2nd anchor
  2. do the same for 1st and 3rd anchor (if the path is a triangle, 2nd and 3rd anchor)
  3. find out intersection point of 1 and 2. for the center of the circumcircle to draw
  4. find out the length of the line connecting the center and 1st anchor, then do the same for the center and 2nd anchor. define longer one as the radius of the circumcircle to draw.

The rightmost one in the picture above is a case of failure.