Visualizing Factors of a Fraction: Dynamic Grouping and Geometric Demonstration
Loading the math board and drawing, please wait…
① This example dynamically demonstrates the factorization of a fraction (e.g., an improper fraction) by visually grouping the factors of numerator and denominator into movable blocks, allowing users to input custom fractions. ② Core mathematical concepts include factorization, fraction simplification, conversion between mixed numbers and improper fractions, as well as geometric mean and integral calculus ideas reflected in the layout design. ③ Construction highlights: uses Textfield and InputBox1 for user input, parses the fraction string via IndexOf and FromBase, computes factors using If, Min, RemoveUndefined, Sequence, First, Zip, and positions elements with Corner; dynamic movement is achieved through Mover and Switcher objects, while multiple points, segments, and text objects render the grouped factors and overall animation. ④ Suitable for middle school to high school students learning factors and fractions, and for teachers to demonstrate the geometric meaning of factorization and fraction structure in class.
GeoGebra Commands & Parameters
Textfield(fraction) → InputBox1Text(InputBox1 + "", false) → fractionTextIndexOf("/", fractionText) → slashLocationFromBase(Take[fractionText, slashLocation + 2, Length[fractionText]], 10) → fakeDIf(valid, fakeN, 1) → NIf(valid, fakeD, 2) → DMin(1, 4 / (ceil(N / wholes) + 1)) → heightIf(wholes > 1, 1 / (wholes - 1), 1) → HgapRemoveUndefined(Sequence[If[N / i ≟ floor(N / i), i], i, 1, N]) → factorsOfNIf(Defined[Element[factorsOfN, Switcher]], Element[factorsOfN, Switcher], 1) → groupsSequence(Max[0, Min[1, (groups * (Mover - k / groups))]], k, 0, groups) → moversFirst(Flatten[Sequence[Sequence[StartingPoint + (((i * spacing) * (length + Hgap)), ((-j) * (height + Vgap))), i, 0, perRow - 1], j, 1, ceil(groups / perRow)]], groups) → newGroupAnchorsSequence(Sequence[Element[newGroupAnchors, j] + ((i * (length + Hgap)), 0), i, 0, Div[N / groups, D] - IsInteger[N / D / groups]], j, 1, Length[newGroupAnchors]) → newWholePointsSequence(Polygon[StartingPoint + (((length + Hgap) * i), 0), StartingPoint + ((length * (i + 1)) + (Hgap * i), 0), StartingPoint + ((length * (i + 1)) + (Hgap * i), height), StartingPoint + (((length + Hgap) * i), height)], i, 0, wholes - 1) → originalWholesSequence(StartingPoint + Point[{(i * length / D) + (Div[i, D] * Hgap), 0}], i, 0, (wholes * D) - 1) → origFractionPointsSequence(Sequence[Element[newGroupAnchors, j] + ((i * length / D) + (Div[i, D] * Hgap), 0), i, 0, N / groups - 1], j, 1, Length[newGroupAnchors]) → groupFractionPointsFirst(Sequence[Sequence[Sequence[Element[newWholePoints, i, j] + ((k * length / D) + (Hgap * Div[k, D]), 0), k, 0, D - 1], j, 1, Length[Element[newWholePoints, i]]], i, 1, Length[newWholePoints]], Sum[floor(movers)]) → extendedFractionPointsSequence(Sequence[Element[origFractionPoints, i + j], i, 1, N / groups], j, 0, N + 1 - N / groups - (groups ≟ N), N / groups) → groupedOrigPointsZip(Segment[AAA, AAA + (0, height)], AAA, Flatten[{origFractionPoints, extendedFractionPoints}]) → fractionLinesZip((AAA * (1 - BBB)) + (CCC * BBB), AAA, groupedOrigPoints, BBB, movers, CCC, groupFractionPoints) → movingPointsZip(Polygon[AAA, AAA + (length / D, 0), AAA + (length / D, height), AAA + (0, height)], AAA, Flatten[movingPoints]) → movingFractionsFirst(Sequence[Sequence[Polygon[Element[newWholePoints, i, j], Element[newWholePoints, i, j] + (length, 0), Element[newWholePoints, i, j] + (length, height), Element[newWholePoints, i, j] + (0, height)], j, 1, ceil(N / groups / D)], i, 1, Length[newWholePoints]], Sum[floor(movers)]) → newWholesZip(Polygon[AAA, AAA + (length / D, 0), AAA + (length / D, height), AAA + (0, height)], AAA, Flatten[groupedOrigPoints]) → origFractionsCorner(5) → A
AI Drawing Prompt Reference
Create a dynamic geometric visualization of fraction factorization. On the left, place an input box for entering a fraction. The numerator and denominator are decomposed into small rectangular blocks, which can be grouped and moved. The top section shows whole-number parts (mixed number), while the bottom shows fractional parts. All blocks are arranged in neat rows and columns, with equal height and width divided by the denominator. Through a slider or dragging, factor blocks smoothly transition from original positions to new grouped positions, preserving total area. Include horizontal segment lines to represent fraction bars, and anchor points to mark grouping locations. The layout is clear and suitable for teaching.
The prompt above was compiled from the original drawing commands and is for reference only.