glass

$\textsf{denominator = %v}$

$\textsf{radius = %v}$

$\text{Show Solution}$

$\text{TRY ANOTHER}$

$\text{SHOW SOLUTION}$

$$

show pieces

\text{Drag to change the dimensions}

countQuestion = 0
allQuestTypes = Shuffle({1, 2})
caseNum = Element(allQuestTypes, Mod[countQuestion, Length[allQuestTypes]] + 1)
heigMax = If(caseNum ≟ 1, 12, 7)
heigMin = If(caseNum ≟ 1, 3, 1)
radMin = If(caseNum ≟ 1, 3, 2)
radMax = If(caseNum ≟ 1, 6, 4)
CB2 = Point(Segment[(radMin, 0), (radMax, 0)])
radDrag: floor(x(CB2))
CB1 = Mirror(CB2, (0, 0))
CT4 = Point(Segment[(x(CB1), heigMin), (x(CB1), heigMax)])
heigDrag: floor(y(CT4))
allItems1 = Shuffle({"glass", "can"})
heigSli = 6 (slider from heigMin to heigMax, step 1)
radSli = 4 (slider from radMin to radMax, step 1)
allItems2 = Shuffle({"cream", "glue", "anchovies", "tuna"})
item2 = Element(allItems2, Mod[countQuestion, Length[allItems2]] + 1)
showSolution = false
rSquaH: (radDrag^(2) * heigDrag)
tryAnother = false
O = If(caseNum ≟ 2, (0, 6), (0, 0))
A: (radSli, y(O))
df: radSli / 11
F1: (x(A) - df, y(A))
F2 = Mirror(F1, O)
H1: A + (0, heigSli)
H2 = Mirror(H1, yAxis)
B = Mirror(A, O)
O': (0, heigSli + y(O))
f = Segment(O', H1)
g = Segment(O', O)
textSolution: "\textsf{\textcolor{#006758}\bold{Possible Solution}}\\\\
\[V=Bh\\
V=(\pi r^2)(h)\\
V=(\pi \cdot \bold\textcolor{#C75000}{" + (LaTeX[radDrag]) + "}^2)(\bold\textcolor{#3A6ED6}{" + (LaTeX[heigDrag]) + "})\\
V=\pi (" + (LaTeX[radDrag^(2)]) + ")(\bold\textcolor{#3A6ED6}{" + (LaTeX[heigDrag]) + "})=" + (LaTeX[rSquaH]) + "\pi \: " + (LaTeX[If[caseNum ≟ 1, " cm^3", " in^3"]]) + "\]\\\\

\textcolor{#006758}\textsf{The volume of the " + (LaTeX[If[caseNum ≟ 1, item1, "can"]]) + " is } \textcolor{#006758}\bold{" + (LaTeX[rSquaH]) + "\pi\: " + (LaTeX[If[caseNum ≟ 1, " cm^3", " in^3"]]) + "}.}"
textQuestion2: "\text{A can of " + (LaTeX[item2]) + " has a radius of \bold\textcolor{#C75000}{" + (LaTeX[radDrag]) + "} inches and a height of \bold\textcolor{#3A6ED6}{" + (LaTeX[heigDrag]) + "} " + (LaTeX[If[heigDrag ≟ 1, "inch", "inches"]]) + ".\\
Change the dimensions to explore how the volume is affected.}"
textQuestion1: "\text{A " + (LaTeX[item1]) + " shaped like a cylinder has a radius of \bold\textcolor{#C75000}{" + (LaTeX[radDrag]) + "} centimeters and a height of \bold\textcolor{#3A6ED6}{" + (LaTeX[heigDrag]) + "} centimeters.\\
Change the dimensions to explore how the volume is affected.}"
textHeight: "\text{" + (LaTeX[heigSli]) + " " + (LaTeX[If[caseNum ≟ 1, "cm", caseNum ≟ 2 ∧ heigSli ≟ 1, "inch", "inches"]]) + "}"
textRad: "\text{" + (LaTeX[radSli]) + " " + (LaTeX[If[caseNum ≟ 1, "cm", "inches"]]) + "}"
displayCan: caseNum ≟ 2
show = true
C: (0, -1)
R: (x(CB2), y(C))
displayRad = Segment(C, R)
HA: (x(CB1) - 1, 0)
HT: (x(CB1) - 1, y(CT4))
displayHeig = Segment(HA, HT)
labelRad: "" + (LaTeX[radDrag]) + "\:" + (LaTeX[If[caseNum ≟ 2, "\textsf{in}", "\textsf{cm}"]]) + ""
labelHeig: "" + (LaTeX[heigDrag]) + "\:" + (LaTeX[If[caseNum ≟ 2, "\textsf{in}", "\textsf{cm}"]]) + ""
onboarding = true
pulsingSpeed: 8
pulsing = 0.3 (slider from 0 to 1, step 0.1)
pulsingObject1 = circlePixels(CT4, 7 + (7 * pulsing), Corner[1], Corner[3], Corner[5])
pulsingObject2 = circlePixels(CB2, 7 + (7 * pulsing), Corner[1], Corner[3], Corner[5])
tabOrder: {textQuestion1, textQuestion2, CT4, labelHeig, CB2, labelRad, btnSol, textSolution, btnNew}

Tool: circlePixels
circlePixels(A,pixelRadius,Corner1,Corner3,Corner5
Input: A, pixelRadius, Corner1, Corner3, Corner5
Output: newCircle

pointRadius: (pixelRadius / x(Corner5) * (x(Corner3) - x(Corner1)))
newCircle = Circle(A, pointRadius)