1
$\begingroup$

I am trying to compute the eccentricity of a polygon in Mathematica.

I see that I can do something similar with ComponentMeasurements, but I am not sure how to get a Graphics[Polygon[]] expression to play nicely with it.

$\endgroup$
0

1 Answer 1

1
$\begingroup$

This seems to work for me:

ComponentMeasurements[
 Graphics[
  Graphics[
   RegularPolygon[5]
   ]
  ]
 , "Eccentricity"]

However, I think you need to invert the colors. Using a test, you need:

ComponentMeasurements[
 Graphics[
  {White, Disk[{0, 0}, 1]}
  , Background -> Black]
 , "Eccentricity"]

to get 0

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.