I see that I was a real "doofus" here and my original question was flawed. You can't divide a polygon like you can a circle or a rectangle, except in special cases... I should have seen that right away, as always, I learn so much connecting with users here.... I can still use the solutions that are being posted, but limit the divisions to special cases... sorry for the poorly thought out question....
I'm working with a grade 7 student and going over fractions.... it's always fractions...
I have a simple demonstration that shows fractions, and then emphasizes equivalent fractions by subdividing the pieces.
Manipulate[
Graphics[{
Flatten[{Red,
Disk[{0, 0}, 1, {(# - 1) 2 \[Pi]/divs, # 2 \[Pi]/divs}] & /@
Range[pieces]}],
{Thickness[0.005], Circle[]},
{Thickness[0.005],
Line /@ Table[{{0, 0}, {Cos[i], Sin[i]}}, {i, 0, 2 \[Pi],
2 \[Pi]/divs}]},
{Thickness[0.001],
Line /@ Table[{{0, 0}, {Cos[i], Sin[i]}}, {i, 0, 2 \[Pi],
2 \[Pi]/(mult divs)}]}},
ImageSize -> 600],
{{divs, 2, "divisions"}, 2, 10, 1, ControlPlacement -> Left},
{{pieces, 1, "pieces"}, 1, divs, 1, ControlPlacement -> Left},
{{mult, 1, "multiplier"}, 1, 10, 1, ControlPlacement -> Left}
]
Same idea with rectangles
Manipulate[
Graphics[{
{Pink, Rectangle [{0, 0}, {60, pieces 100/divs}]},
{Thickness[0.005],
Line[{{0, 0}, {60, 0}, {60, 100}, {0, 100}, {0, 0}}]},
{Thickness[0.005],
Line /@ Table[{{0, i 100/divs}, {60, i 100/divs}} , {i, 1,
divs}]},
{Thickness[0.001],
Line /@ Table[{{i 60/divs2, 0}, { i 60/divs2, 100}} , {i, 1,
divs2}]}
}, ImageSize -> 500],
{{divs, 2, "vertical"}, 1, 10, 1, ControlPlacement -> Left},
{{divs2, 1, "horizontal"}, 1, 10, 1, ControlPlacement -> Left},
{pieces, 1, divs, 1, ControlPlacement -> Left}
]
Okay, my polygon demonstration is sort of working, but way out of my depth here... if I "subdivide" the polygon to show equivalent fractions, I'd need to find points on the polygon, but the "easy" points are on the enclosing circle.
Manipulate[Module[{perimeter, spokes, shaded, minispokes},
perimeter =
Line[Table[{Cos[i], Sin[i]}, {i, 0, 2 \[Pi], 2 \[Pi]/divs}]];
spokes =
Line /@ Table[{{0, 0}, {Cos[i], Sin[i]}}, {i, 0, 2 \[Pi],
2 \[Pi]/divs}];
minispokes =
Line /@ Table[{{0, 0}, {Cos[i], Sin[i]}}, {i, 0, 2 \[Pi],
2 \[Pi]/(mult divs)}];
shaded = {Green,
Polygon[Flatten[{ {{0, 0}},
Table[{Cos[i], Sin[i]}, {i, 0, pieces 2 \[Pi]/divs,
2 \[Pi]/divs}], {{0, 0}}}, 1]]};
Graphics[{shaded, {Thickness[0.005], perimeter,
spokes}, {Thickness[0.001], minispokes}}, ImageSize -> 500,
PlotRange -> {{-1, 1}, {-1, 1}}]
],
{{divs, 5, "sides"}, 1, 12, 1, ControlPlacement -> Left},
{{pieces, 1, "pieces"}, 1, divs, 1, ControlPlacement -> Left},
{{mult, 1, "multiplier"}, 1, 10, 1, ControlPlacement -> Left}
]
Hopefully my problem makes sense. How would I create those subdivision lines so the endpoints are on the polygon, not on the circle?
I'd welcome any suggestions, feedback, etc.
Tom
minispokes = Line@Flatten[Table[{{0, 0}, m/mult {Cos[2 \[Pi] d/divs], Sin[2 \[Pi] d/divs]} + (1 - m/mult) {Cos[2 \[Pi] (d - 1)/divs], Sin[2 \[Pi] (d - 1)/divs]}}, {m, 1, mult - 1}, {d, divs}], 1]
$\endgroup$