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.
Mathematica Stack Exchange is a question and answer site for users of Wolfram Mathematica. It only takes a minute to sign up.
Sign up to join this communityThis 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