\textsf{Select two points on the graph to find the distance between them.}

$\bold\math{d}$

d:\textsf{Distance between }A(x_{1}, y_{1})\\textsf{and }B(x_{2}, y_{2})

\textsf{Using Pythagorean Theorem:}

restart

1 = arrow left, 2 = arrow right, 3 = arrow uo, 4 = arrow down

Reset App

$\textsf{TRY OTHER POINTS}$

AppSize = Corner(5)
MoveGuideLine = (8.745810094999989, -5.834230245600008)
hGuideline: y = y(MoveGuideLine)
vGuideline: x = x(MoveGuideLine)
graphView = Polygon({(-6.5, -6.5), (6.5, -6.5), (6.5, 6.5), (-6.5, 6.5)})
fakeXAxis = Segment((-6.5, 0), (6.5, 0))
fakeYAxis = Rotate(fakeXAxis, pi / 2)
eq1: x = x(Corner[1]) + (x(Corner[2] - Corner[1]) / 800 * 16)
hGuideline' = Translate(hGuideline, Vector[(Vector[Corner[1], Corner[4]] / 500 * 16)])
Cor1 = (-7.076645399999993, -7.224809000000006)
Cor3 = (18.75593499999998, 8.944711400000003)
P1: (-1, -2)
P2 = (2, 2)
P3_{1} = (-1, 3)
P8: (5, -5)
P5 = (-4, 0)
P6: (-1, 4)
P7: (-4, -3)
P3: (2, 1)
ind1 = NaN
ind2 = NaN
labelXAxis = Text("x", (6.8, 0.1), true, true, 0, 0)
labelYAxis = Text("y", (0, 7), true, true, 0, 0)
P4: (2, 1)
B = Element({P1, P2, P3, P4, P5, P6, P7, P8}, ind2)
A = Element({P1, P2, P3, P4, P5, P6, P7, P8}, ind1)
AAbove: y(A) ≥ y(B)
C: (x(B), y(A))
anim = 0 (slider from 0 to 2, step 0.1)
dist = Segment(A, A + (Min[(2 * anim), 1] * (B - A)))
ALeft: x(A) ≤ x(B)
labelA = Text("A(x_{1},y_{1})", A, true, true, If[ALeft, -1, 1], If[AAbove, 1, -1])
labelC = Text("C(x_{2},y_{1})", C, true, true, If[ALeft, 1, -1], If[AAbove, 1, -1])
cat1 = Segment(A, C)
cat2 = Segment(B, C)
labelB = Text("B(x_{2},y_{2})", B, true, true, 0, If[AAbove, -1, 1])
PosD: Midpoint[dist] + (If[ALeft, -1, 1], If[AAbove, -1, 1])
PosCat1: Midpoint[cat1] + (0, 0)
PosCat2: Midpoint[cat2] + (If[ALeft, 0.25, -0.25], 0)
PosDDef = If(Defined[PosD], PosD, (500, 500))
FixedLabelD = Text("d", PosDDef, true, true, 0, 0)
PosCat1Def = If(Defined[PosCat1], PosCat1, (500, 500))
FixedLabelCat1 = Text("x_2-x_1", PosCat1Def, true, true, 0, If[AAbove, 1, -1])
PosCat2Def = If(Defined[PosCat2], PosCat2, (500, 500))
FixedLabelCat2 = Text("y_2-y_1", PosCat2Def, true, true, If[ALeft, 1, -1], 0)
C1 = Corner(FixedLabelCat1, 1)
C2 = Corner(FixedLabelCat2, 1)
C3 = Corner(FixedLabelD, 1)
eq2: x = 7.25
D1 = (498.69298810649946, 498.9458576016003)
D2 = (497.4013590864995, 499.36626513200036)
D3 = (499.5648376949995, 499.39860417280033)
dimsBox1: (2.8, 1.07)
dimsBox2: (2.8, 1.07)
dimsBox3: Corner[FixedLabelD, 3] - Corner[FixedLabelD, 1] + (0, 0.1)
Box1, d1, f, g, h = Polygon(D1, D1 + (x(dimsBox1), 0), D1 + dimsBox1, D1 + (0, y(dimsBox1)))
Box2, d2, i, j, k = Polygon(D2, D2 + (x(dimsBox2), 0), D2 + dimsBox2, D2 + (0, y(dimsBox2)))
Box3, d3, l, m, n = Polygon(D3, D3 + (x(dimsBox3), 0), D3 + dimsBox3, D3 + (0, y(dimsBox3)))
Homes: {C1, C2, C3}
T3: (8.5, 2)
Blank3 = Polygon({T3, T3 + (x(dimsBox3), 0), T3 + dimsBox3, T3 + (0, y(dimsBox2))})
T2 = Translate(T3, (2.1, 0))
Blank2 = Polygon({T2, T2 + (x(dimsBox2), 0), T2 + dimsBox2, T2 + (0, y(dimsBox2))})
Blank1 = Translate(Blank2, (4, 0))
T1 = Vertex(Blank1, 1)
textBox2 = Text(If[D2 ∈ {T1, T2}, "(y_2-y_1)", "y_2-y_1"], D2 + (1 / 2 * dimsBox2), true, true, 0, 0)
textBox1 = Text(If[D1 ∈ {T1, T2}, "(x_2-x_1)", "x_2-x_1"], D1 + (1 / 2 * dimsBox1), true, true, 0, 0)
targets: {T1, T2, T3}
InMov = Zip(¬Defined[IndexOf[PP, Union[Homes, targets]]], PP, {D1, D2, D3})
colorDragTiles = Sequence((((((((("SetDynamicColor( Box" * kk) * ", If(InMov(") * kk) * "),226,238)/255, If(InMov(") * kk) * "),223,238)/255, If(InMov(") * kk) * "),248,238)/255)"), kk, 1, 3)
eq1' = Mirror(eq1, Midpoint[Cor1, Cor3])
textPytTheorem = Text("\hspace{20}^2=\hspace{90}^2+\hspace{90}^2", T3, true, true, 1, 1)
box1InReg = IndexOf(true, Zip[IsInRegion[Centroid[Box1], BB], BB, {Blank1, Blank2, Blank3}])
box2InReg = IndexOf(true, Zip[IsInRegion[Centroid[Box2], BB], BB, {Blank1, Blank2, Blank3}])
box3InReg = IndexOf(true, Zip[IsInRegion[Centroid[Box3], BB], BB, {Blank1, Blank2, Blank3}])
Blank1H: Blank1
Blank2H: Blank2
Blank3H: Blank3
highlightBlank = Element({box1InReg, box2InReg, box3InReg}, IndexOf[true, InMov])
textStep3: "\textcolor{#DA2570}{d}^2=" + (LaTeX[If[box1InReg ≟ 2, textBox1, textBox2]]) + "^2+" + (LaTeX[If[box1InReg ≟ 1, textBox1, textBox2]]) + "^2"
textStep4: "\sqrt{\textcolor{#DA2570}{d}^2}=\sqrt{" + (LaTeX[If[box1InReg ≟ 2, textBox1, textBox2]]) + "^2+" + (LaTeX[If[box1InReg ≟ 1, textBox1, textBox2]]) + "^2"
textStep5: "\textcolor{#DA2570}{d}=\sqrt{" + (LaTeX[If[box1InReg ≟ 2, textBox1, textBox2]]) + "^2+" + (LaTeX[If[box1InReg ≟ 1, textBox1, textBox2]]) + "^2}"
speed: 2
finish: (¬Defined[IndexOf[true, InMov]]) ∧ Length[RemoveUndefined[{box1InReg, box2InReg, box3InReg}]] ≟ 3
textBox3 = Text("d", D3 + (1 / 2 * dimsBox3), true, true, 0, 0)
tabOrder: {questionText, P1, P2, P3, P5, P6, P7, P8, A, B, textStep1, textStep2, Box1, Box2, Box3, textStep3, textStep4, textStep5}
pulsingSpeed: 8
pulsing = 0.8 (slider from 0 to 1, step 0.1)
pulsingObjectA = expandQuad(Vertex[Box1, 1], Vertex[Box1, 2], Vertex[Box1, 3], Vertex[Box1, 4], (7 * pulsing), Cor1, Cor3, (800, 500))
pulsingObjectB = expandQuad(Vertex[Box2, 1], Vertex[Box2, 2], Vertex[Box2, 3], Vertex[Box2, 4], (7 * pulsing), Cor1, Cor3, (800, 500))
pulsingObjectC = expandQuad(Vertex[Box3, 1], Vertex[Box3, 2], Vertex[Box3, 3], Vertex[Box3, 4], (7 * pulsing), Cor1, Cor3, (800, 500))
onboarding = true
onboardingXStage1 = If(ind1 ≟ 7 ∧ ind2 ≟ 8 ∨ anim ≟ 0, 400, (x(Midpoint[Vertex[Box3, 1], Vertex[Box3, 2]] - Cor1) * 800 / x(Cor3 - Cor1)) - 12)
onboardingX_{1}: onboardingXStage1
onboardingYStage1 = If(ind1 ≟ 7 ∧ ind2 ≟ 8 ∨ anim ≟ 0, 444, (y(Cor3 - Midpoint[Vertex[Box3, 1], Vertex[Box3, 2]]) * 500 / y(Cor3 - Cor1)) - If[AAbove, -30, 40])
onboardingY_{1}: onboardingYStage1
onboardingText_{1}: "\text{" + (LaTeX[If[anim ≟ 0, "Select two points", "Drag into the blanks"]]) + "}"
onboardingCase_{1} = If(ind1 ≟ 7 ∧ ind2 ≟ 8 ∨ anim ≟ 0, 1, 4 - AAbove)
OnboardingTextOffset_{1} = onboardingTextOffset(Corner[onboardingText_{1}, 1], Corner[onboardingText_{1}, 3], onboardingCase_{1}, Corner[1], Corner[3], Corner[5])
onboardingDisplayText_{1}: "\text{\vphantom{Og}" + (LaTeX[onboardingText_{1}]) + "}"
pulsingObject2 = circlePixels(P2, 9 + (7 * pulsing), Cor1, Cor3, (800, 500))
pulsingObject1 = circlePixels(P1, 9 + (7 * pulsing), Cor1, Cor3, (800, 500))
pulsingObject3 = circlePixels(P3, 9 + (7 * pulsing), Cor1, Cor3, (800, 500))
pulsingObject5 = circlePixels(P5, 9 + (7 * pulsing), Cor1, Cor3, (800, 500))
pulsingObject6 = circlePixels(P6, 9 + (7 * pulsing), Cor1, Cor3, (800, 500))
pulsingObject7 = circlePixels(P7, 9 + (7 * pulsing), Cor1, Cor3, (800, 500))
pulsingObject8 = circlePixels(P8, 9 + (7 * pulsing), Cor1, Cor3, (800, 500))
firstround = true
showpoints: (¬Defined[ind1]) ∨ (¬Defined[ind2])
set = 1
a = If(set ≟ 1, 2, 1)
b = If(set ≟ 1, 2, 1)
c = If(set ≟ 1, 2, 1)
d = If(set ≟ 1, 2, 1)
e = If(set ≟ 1, 2, 1)
o = If(set ≟ 1, 2, 1)
p = If(set ≟ 1, 2, 1)
speedSeg = If(anim ≤ 1, 5, 3)

Tool: expandQuad
expandQuad(A,B,C,D,pixelGap,Corner1,Corner3,Corner5)
Input: A, B, C, D, pixelGap, Corner1, Corner3, Corner5
Output: newPolygon

Corner5: (800, 500)
Corner3: (7, 6)
Corner1: (-4, -2)
distanceY: (pixelGap / y(Corner5) * (y(Corner3) - y(Corner1)))
distanceX: (pixelGap / x(Corner5) * (x(Corner3) - x(Corner1)))
pointGap: distanceX
allVerts: {A, B, C, D}
concaveAngles = Zip(Angle[I, J, K] > 180°, I, Append[allVerts(-1), allVerts], J, allVerts, K, Append[Take[allVerts, 2], allVerts(1)])
allVecs = Zip(Vector[J, K], J, allVerts, K, Append[Take[allVerts, 2], allVerts(1)])
pVecs = Zip(Vector[UnitOrthogonalVector[A]], Vector[A], allVecs)
xyScale: (distanceY) / (distanceX)
circTemplate = CurveCartesian((pointGap * cos(t)), ((xyScale * pointGap) * sin(t)), t, 0, (2 * pi))
scaledVecs = Zip(Vector[(x(K), (xyScale * y(K)))], Vector[K], pVecs)
vPointsPre = Zip(A - (pointGap * B), A, allVerts, B, Append[scaledVecs(-1), scaledVecs])
vPointsPost = Zip(A - (pointGap * B), A, allVerts, Vector[B], scaledVecs)
endAngles = Zip(Angle[M + (1, 0), M, K], K, vPointsPost, M, allVerts)
startAngles = Zip(Angle[M + (1, 0), M, K], K, vPointsPre, J, vPointsPost, M, allVerts)
roundedCornersConvex = Zip(Sequence[circTemplate(K) + A, K, B, C + If[B > C, (2 * pi), 0], (C + If[B > C, (2 * pi), 0] - B) / 4], A, allVerts, B, endAngles, C, startAngles)
roundedCornersConcave = Zip(Sequence[circTemplate(K) + A, K, B, C + If[B > C, (2 * pi), 0], (C + If[B > C, (2 * pi), 0] - B) / 4], A, allVerts, B, startAngles, C, endAngles)
cornerAngles = Zip(Angle[A, B, C], A, vPointsPre, B, allVerts, C, vPointsPost)
cornerPoints = Flatten(Zip[If[¬Concave, {Element[D, 3]}, If[A < pi / 3 ∨ (¬Concave), {Element[C, 3]}, C]], A, cornerAngles, C, roundedCornersConcave, D, roundedCornersConvex, Concave, concaveAngles])
newPolygon = Polygon(cornerPoints)

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: onboardingTextOffset
onboardingTextOffset(textCorner1,textCorner3,case,corner1,corner3,corner5)
Input: CornerText1, CornerText3, case, Corner1, Corner3, Corner5
Output: TextOffset

xPixels: ((x(CornerText3) - x(CornerText1)) * x(Corner5) / (x(Corner3) - x(Corner1)))
yPixels: ((y(CornerText3) - y(CornerText1)) * y(Corner5) / (y(Corner3) - y(Corner1)))
xOffset = Element({27, (-xPixels) + 2, 16 - xPixels / 2, 16 - xPixels / 2}, case)
yOffset = Element({-23, -23, yPixels - 27, -49}, case)
TextOffset: (xOffset, yOffset)

Tool: onboardingTextOffset (command onboardingTextOffset1)
onboardingTextOffset(textCorner1,textCorner3,case,corner1,corner3,corner5)
Input: CornerText1, CornerText3, case, Corner1, Corner3, Corner5
Output: TextOffset

xPixels: ((x(CornerText3) - x(CornerText1)) * x(Corner5) / (x(Corner3) - x(Corner1)))
yPixels: ((y(CornerText3) - y(CornerText1)) * y(Corner5) / (y(Corner3) - y(Corner1)))
xOffset = Element({27, (-xPixels) + 2, 16 - xPixels / 2, 16 - xPixels / 2}, case)
yOffset = Element({-23, -23, yPixels - 27, -49}, case)
TextOffset: (xOffset, yOffset)