#DA2570

#0F8538

$\math{A}$

# determines the index of {0,0.25,0.5,0.75,1} which the first point rounds to.

$\math{A}$

#4D4D4D

Reset app

#006758

#B00020

#252525

#757575

#949494

#E44461

#E66B9E

#3A6ED6

#5991FF

#008475

#00a83c

#5145A8

#6557D2

#8575FF

#903D14

#BD6C43

#C75000

#E07415

#eeeeee

#2E006758

#2EB00020

$\textbf\textsf{ROUND}$

$\textbf\textsf{TRY ANOTHER}$

\text{Approximate the sum of two numbers.}

\text{Approximate}

for this applet, always bump a number up when rounding, since numbers are always positive.

\text{Exact}

$\mathsf{%v}$

$\text{SECOND NUMBER}$

$\mathsf{%v}$

$\mathsf{%v}$

$\mathsf{%v}$

\text{Drag to choose first number}

randomUnits = Shuffle({1, 2, 3, 4, 5, 6})
randomTenths = Shuffle({1, 2, 3, 4, 5, 6, 7, 8, 9, 5, 5, 5, 5, 5})
randomValues = RandomUniform(1, 20, 100)
bValues: {0.7000000000000004, 0.75}
aValues: {0.5200000000000002, 0.5}
sumExact: aValues(1) + bValues(1)
sumApprox: aValues(2) + bValues(2)
step = 1
animateControl = 0 (slider from 0 to 6, step 0.01)
animateStage4 = If(animateControl < 5, 0, If[animateControl > 6, 1, animateControl - 5])
AnchorResult = (-0.34989029198236915, -2.320843440960719)
heightD = 1.039671336912636
animateMoveA = Element({animateStage4, 1}, step)
Anchor1: (0, heightD)
heightA = -0.5795306837967054
heightB: heightA + (1 / 4 * (heightD - heightA))
heightC: heightA + (1 / 2 * (heightD - heightA))
allX = Sequence(0, 1, 0.25)
zigZag = PolyLine(Flatten[Sequence[{(K, heightB), If[K ≠ allX(-1), (K + 0.125, heightC)]}, K, allX(1), allX(-1), 0.25]])
PStart = Point(Sequence[Anchor1 + (A, 0), A, 0.01, 0.99, 0.01])
roundedIndexA = IndexOf(true, Zip[A ≤ x(PStart) < B, A, {0, 0.125, 0.375, 0.625, 0.875}, B, {0.125, 0.375, 0.625, 0.875, 1.125}])
roundedValue = Element({0, 0.25, 0.5, 0.75, 1}, roundedIndexA)
randomIndex = 88
BUMPLEFT: -1
BUMPRIGHT: 1
randomNums = Zip(round(A), A, randomValues)
minX: 0
animateStage1 = If(animateControl < 1, animateControl, 1)
tickIncrement: 1 / 20
allTickPositions = Sequence(allX(1), allX(-1), tickIncrement)
currentNum: x(PStart)
pathPoints: {PStart, Intersect[Line[PStart, yAxis], zigZag] + (0, 0.1), Intersect[Line[(roundedValue, y(PStart)), yAxis], zigZag] + (0, 0.1), (roundedValue, heightA)}
dropDistance: y(PStart) - y(pathPoints(-1))
ballPath = PolyLine(pathPoints)
stopDistance: y(PStart) - y(pathPoints(2))
bumpNeeded = Defined(IndexOf[x(PStart), {0.125, 0.375, 0.625, 0.875}])
animateStage2 = If(animateControl < 1 ∨ (¬bumpNeeded), 0, If[animateControl > 2, 1, animateControl - 1])
heightLineNoBump = Line(pathPoints(1) - (0, If[bumpNeeded, (stopDistance * animateStage1) + ((1 - stopDistance) * animateStage2), (Min[3, animateControl] / 3 * dropDistance)]), xAxis)
animateStage3 = If(animateControl < 1 + bumpNeeded, 0, If[animateControl > 2 + bumpNeeded, 1, animateControl - 1 - bumpNeeded])
heightLineBump = Line(pathPoints(1) - (0, (animateStage1 * stopDistance) + (animateStage3 * (dropDistance - stopDistance))), xAxis)
approximateLatex: "\textcolor{" + (LaTeX[colorPink]) + "}{" + (LaTeX[aValues(2)]) + "}+\textcolor{" + (LaTeX[colorGreen]) + "}{" + (LaTeX[bValues(2)]) + "}=" + (LaTeX[aValues(2) + bValues(2)]) + ""
displayRoundedA: "" + ((approximateLatex * roundedIndexA)) + ""
PMove = Intersect(If[bumpNeeded, heightLineBump, heightLineNoBump], ballPath)
validate = false
showanswer = false
showsolution = false
showbuttons = true
pixelsRight: 16
pixelsLeft: 16
speed: 8
pixelsBottom: 16
pixelsTop: 24
basketPoints: {((-2 * tickIncrement), (tickIncrement * 2)), ((-1.5 * tickIncrement), (-1.5 * tickIncrement)), ((1.5 * tickIncrement), (-1.5 * tickIncrement)), ((tickIncrement * 2), (tickIncrement * 2))}
maxX: 1
tickSize = Zip(If[IsInteger[(A * 4)], 0.15, If[IsInteger[(A * 8)], 0.1, 0.05]], A, allTickPositions)
holes = Zip(Circle[(CLIPBOARDmagicSTRINGA, heightB), 0.12], CLIPBOARDmagicSTRINGA, allX)
BumpStart: (0, y(pathPoints(2)))
BumpEnd: (x(BumpStart) + ((animateStage2 - Max[0, animateStage3 - 0.2]) * (x(PStart) - x(BumpStart))), y(BumpStart))
bumper = Segment(BumpStart, BumpEnd)
PlaceHolder: PStart
currentPath = PolyLine(Append[RemoveUndefined[Zip[If[y(A) > y(PMove), A], A, pathPoints]], PMove])
displayX: {0, 0.25, 0.5, 0.75, 1}
pulsing = 0.6 (slider from 0 to 1, step 0.1)
pulsingSpeed: 8
onboarding = true
speedFunc = If(animateControl < 4, (If[bumpNeeded, 1, 3] * x) + 3, 1)
ticks1 = Zip(Segment[(A, heightD - B), (A, heightD + B)], A, allTickPositions, B, tickSize)
ticks2 = Zip(Segment[(A, heightA - 0.15), (A, heightA)], A, allX)
numberLine1 = Segment((allX(1) - 0.03, heightD), (allX(-1) + 0.03, heightD))
numberLine2 = Translate(numberLine1, (0, heightA - heightD))
vTrans: (0, heightA - heightD)
bumpDirection: BUMPLEFT
segmentA = Segment(Translate[Anchor1, Vector[(animateMoveA * Vector[Anchor1, AnchorResult])]], Translate[(aValues(1), heightD), Vector[(animateMoveA * Vector[Anchor1, AnchorResult])]])
ballColor = Element({{218 / 255, 37 / 255, 112 / 255}, {15 / 255, 133 / 255, 56 / 255}}, step)
vTransAvalue = Vector(Anchor1, AnchorResult)
vTransBValue = Vector(Anchor1, AnchorResult + (segmentA, 0))
AnchorRounded: AnchorResult + (0, -1.5)
vTransARounded = Vector(Anchor1 + vTrans, AnchorRounded)
segARounded = Segment(Translate[Anchor1 + vTrans, Vector[(animateMoveA * vTransARounded)]], Translate[(aValues(2), heightA), Vector[(animateMoveA * vTransARounded)]])
aValueSaved: 1
aRoundedSaved: 1
animateMoveB = Element({0, animateStage4}, step)
vTransBRounded = Vector(Anchor1 + vTrans, AnchorRounded + (segARounded, 0))
segBRounded = Segment(Translate[Anchor1 + vTrans, Vector[(animateMoveB * vTransBRounded)]], Translate[(bValues(2), heightA), Vector[(animateMoveB * vTransBRounded)]])
segmentB = Segment(Translate[Anchor1, Vector[(animateMoveB * vTransBValue)]], Translate[(bValues(1), heightD), Vector[(animateMoveB * vTransBValue)]])
pulsingCircle = expandCircle(PStart, 7 + (7 * pulsing), Corner[1], Corner[3], Corner[5])
onboardingX = 415
onboardingY = 85
lblPoint = Text(("" * currentNum), PStart + (0, 0.4), false, true, 0, 0)
exactLatex: "\textcolor{" + (LaTeX[colorPink]) + "}{" + (LaTeX[aValues(1)]) + "}+\textcolor{" + (LaTeX[colorGreen]) + "}{" + (LaTeX[bValues(1)]) + "}=" + (LaTeX[Sum[{aValues(1), bValues(1)}]]) + ""
sumDisplay: "\textsf{Exact: }" + (LaTeX[If[animateMoveB ≟ 1, exactLatex, ""]]) + "\\\vspace{70px}
\\
\textsf{Approximate: }" + (LaTeX[If[animateMoveB ≟ 1, approximateLatex, ""]]) + ""
textResultContents: "\(" + (LaTeX[aValues(1)]) + "+" + (LaTeX[bValues(1)]) + "" + (LaTeX[If[sumApprox ≟ sumExact, "=", "\approx"]]) + "" + (LaTeX[sumApprox]) + "\) "
P1Shadow: (aValues(1), y(PStart))
digits1 = Zip(Text[("" * A), (B, heightD - 0.1), true, true, 0, -1], A, displayX, B, allX)
digits2 = Zip(Text[("" * A), (B, heightD - 0.1) + vTrans, true, true, 0, -1], A, displayX, B, allX)
P1ShadowApprox: (aValues(2), y(PStart)) + vTrans
pathAPoints: {(0.5200000000000002, 1.039671336912636), (0.5200000000000002, -0.009962097790995633), (0.5, -0.07473017861937001), (0.5, -0.5795306837967054)}
pathAShadow = PolyLine(pathAPoints)
showPMove: 0 < animateControl < 4
P2ShadowApprox: (bValues(2), y(PStart)) + vTrans
firstAttempt = true

Tool: PixelsToPoint
PixelsToPoint(Corner1,Corner3,Corner5,PixelCoords)
Input: Corner1, Corner3, Corner5, InputPixels
Output: OutputPoint

InputPixels: (100, 200)
xRight: x(Corner3)
xLeft: x(Corner1)
yTop: y(Corner3)
yBottom: y(Corner1)
yCoord: yTop - (y(InputPixels) / y(Corner5) * (yTop - yBottom))
xCoord: (x(InputPixels) / x(Corner5) * (xRight - xLeft)) + xLeft
OutputPoint: (xCoord, yCoord)

Tool: PixelsToPoint (command PixelsToPoint1)
PixelsToPoint(Corner1,Corner3,Corner5,PixelCoords)
Input: Corner1, Corner3, Corner5, InputPixels
Output: OutputPoint

InputPixels: (100, 200)
xRight: x(Corner3)
xLeft: x(Corner1)
yTop: y(Corner3)
yBottom: y(Corner1)
yCoord: yTop - (y(InputPixels) / y(Corner5) * (yTop - yBottom))
xCoord: (x(InputPixels) / x(Corner5) * (xRight - xLeft)) + xLeft
OutputPoint: (xCoord, yCoord)

Tool: centerText
centerText(sizeStr,textStr)
Input: sizeStr, textString
Output: centeredLatex

this is dynamic centered text

centeredLatex: (((("\begin{tabular}\hspace{" * sizeStr) * "}\\") * textString) * "\end{tabular}")

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)

Tool: expandCircle
expandCircle(A,pixelRadius,Corner1,Corner3,Corner5)
Input: A, pixelRadius, Corner1, Corner3, Corner5
Output: newEllipse

distanceX: (pixelRadius / x(Corner5) * (x(Corner3) - x(Corner1)))
distanceY: (pixelRadius / y(Corner5) * (y(Corner3) - y(Corner1)))
xyScale: distanceY / distanceX
pointGap: distanceX
cMinor = Min(pointGap, (pointGap * xyScale))
cMajor = Max(pointGap, (pointGap * xyScale))
f1: sqrt(cMajor^(2) - cMinor^(2))
A: (3, 4)
newEllipse = If(xyScale < 1, Ellipse[A + (f1, 0), A + ((-f1), 0), A + (cMajor, 0)], Ellipse[A + (0, f1), A + (0, (-f1)), A + (0, cMajor)])