${%n}$

$%n$

$\math{B}$

$\math{A}$

\text{Intersecting lines will cross or \
meet each other. }

\text{Perpendicular lines intersect\
each other at a right angle.}

\text{Parallel lines will never intersect.}

#4D4D4D

$\text{Check}$

$\text{NEW PROBLEM}$

Fix position and allow selection for all text objects

Empty all input boxes

\text{}

$a=\vphantom{b}$

$b=$

Reset app

#006758

#B00020

#252525

#757575

#949494

#E44461

#DA2570

#E66B9E

#3A6ED6

#5991FF

#008475

#0F8538

#00a83c

#5145A8

#6557D2

#8575FF

#903D14

#BD6C43

#C75000

#E07415

#eeeeee

#2E006758

#2EB00020

\text{Drag to move}

A

B

\textsf{Parallel lines will never intersect, so they}\
\textsf{will have a constant distance between}\
\textsf{them. Many possible lines parallel to}\
\textsf{line } AB \textsf{ can be drawn. One possible line is}\
\textsf{displayed on the right.}

\textsf{Perpendicular lines will intersect each other}\
\textsf{at a right angle. Many possible lines}\
\textsf{perpendicular to line }AB \textsf{ can be drawn.}\
\textsf{One possible line is displayed on the right.}

\textsf{Intersecting lines are two or more}\
\textsf{lines that cross or meet each other.} \
\textsf{Many possible lines that intersect}\
\textsf{line }AB \textsf{ can be drawn. One possible}\
\textsf{line is displayed on the right.}

\text{In this activity, intersecting lines\meet at one point.}

\text{In this activity, coinciding lines\are not considered.}

countQuestion = 0
bigGrid = Join(Sequence[Sequence[(j, k), j, -5, 5, 1], k, -5, 5, 1])
whereC = IndexOf((-4, 5), bigGrid)
whereD = IndexOf((4, 5), bigGrid)
BPGrid = Shuffle(Sequence[(j, -3), j, -3, 3, 3])
C = Point(bigGrid)
D = Point(bigGrid)
studLine = Line(C, D)
allParLines = Shuffle({y = (2 * x), y = (2 * x) + 1, y = (2 * x) - 1, y = (-2 * x), y = (-2 * x) + 1, y = (-2 * x) - 1, y = x, y = x + 1, y = x - 1, y = (-x), y = (-x) + 1, y = (-x) - 1, x = -3, x = -2, x = -1, x = 0, x = 1, x = 2, x = 3})
givenPar = Element(allParLines, Mod[countQuestion, Length[allParLines]] + 1)
APGrid = Shuffle(Sequence[(j, 3), j, -3, 3, 3])
AGrid = Shuffle(Join[Sequence[Sequence[(j, k), j, -3, 3, 1], k, -3, 3, 1]])
allCases = Shuffle({1, 2, 3})
caseNum = Element(allCases, Mod[countQuestion, Length[allCases]] + 1)
A = Element(If[caseNum ≠ 2, AGrid, APGrid], Mod[countQuestion, Length[If[caseNum ≠ 2, AGrid, APGrid]]] + 1)
BGrid = Shuffle(Join[Sequence[Sequence[(j, k), j, -3, 3, 1], k, -3, 3, 1]] \ {A})
B = If(caseNum ≠ 2, Element[BGrid, Mod[countQuestion, Length[BGrid]] + 1], Mirror[A, (0, 0)])
givenLine = If(caseNum ≠ 1, Line[A, B], givenPar)
IPR = Intersect(givenLine, studLine)
peep, f, g, h, i = Polygon((-5.2, -5.2), (5.2, -5.2), (5.2, 5.2), (-5.2, 5.2))
correctPar: AreParallel[givenLine, studLine] ∧ studLine ≠ givenLine ∧ caseNum ≟ 1
displayStudL = Segment(C, D)
ABpeep, j, k, l, m = Polygon((-4.5, -4.5), (4.5, -4.5), (4.5, 3.5), (-4.5, 3.5))
intGivenLine: {Intersect[givenLine, ABpeep]}
displayGivenL = Segment(intGivenLine(1), intGivenLine(2))
ptInPeep = If(caseNum ≠ 1, IsInRegion[IPR, peep], true)
IP = Intersect(displayGivenL, displayStudL)
mStud = Slope(studLine)
isTypicalError1: caseNum ≟ 1 ∧ (¬correctPar) ∧ (¬ptInPeep)
mGiven = Slope(givenLine)
correctInt: mStud ≠ mGiven ∧ Defined[IPR] ∧ studLine ≠ givenLine ∧ caseNum ≟ 3
isTypicalError2: caseNum ≟ 3 ∧ Defined[IPR] ∧ (¬ptInPeep) ∧ (¬correctPar)
inputSaved: {(-4, 5), (4, 5)}
inputCurrent: {C, D}
coincidentLines: studLine ≟ givenLine
BF: intGivenLine(2)
AF: intGivenLine(1)
intStudLine: {Intersect[studLine, peep]}
correctPer: ArePerpendicular[studLine, givenLine] ∧ caseNum ≟ 2
input1 = NaN
randomList2 = Shuffle(Sequence[15])
input2 = NaN
randomNum2 = Element(randomList2, Mod[countQuestion, 15] + 1)
onboarding = true
validate = false
showanswer = false
showsolution = false
tries = 0
countCorrect = 0
showhint = false
InputBox1 = Textfield(input1)
InputBox2 = Textfield(input2)
correct: (correctInt ∨ correctPar ∨ correctPer) ∧ ptInPeep
showbuttons = true
typicalError1: 0
typicalError2: 0
helpTextHintTypicalError: "\text{" + (LaTeX[If[isTypicalError1, "The lines will meet off screen.", isTypicalError2, "The lines will meet off screen.\\Draw lines that will intersect on screen."]]) + "}"
showhinttypicalerror = false
textCountCorrect: "\text{Number correct: " + (LaTeX[countCorrect]) + " }"
labelBtnValidate: "\text{CHECK (" + (LaTeX[3 - tries]) + ")}"
pixelsRight: 16
pixelsLeft: 16
pixelsBottom: 16
pixelsTop: 24
borderBox = Polygon(Zip[PixelsToPoint[Corner[1], Corner[3], Corner[5], A], A, {(pixelsLeft, pixelsTop), (pixelsLeft, y(Corner[5]) - pixelsBottom), Corner[5] - (pixelsRight, pixelsBottom), (x(Corner[5]) - pixelsRight, pixelsTop)}])
layoutY: 178
enableInput: tries < 3 ∧ (¬(validate ∧ correct))
layoutX: 16
layoutAppSize = Corner(5)
enableBtnValidate: inputCurrent ≠ inputSaved ∧ inputCurrent ≠ {0} ∧ (¬coincidentLines)
textFeedback: "" + (LaTeX[If[correct, "$\text{✓ Correct}$", "$\text{✕ " + (If[tries < 3, "Try again", "Maybe next time"]) + "}$"]]) + ""
StartA = (3.4347091871177713, 5.572495645015256)
StartB = (4.1638207264560645, 6.136241785204535)
pulsingSpeed: 8
pulsing = 1 (slider from 0 to 1, step 0.1)
haloPixels: (pulsing * 7)
count = 2
onboardingCase: 4
onboardingX: 337
onboardingY: 150
OnboardingTextOffset = onboardingTextOffset(Corner[onboardingText, 1], Corner[onboardingText, 3], onboardingCase, Corner[1], Corner[3], Corner[5])
onboardingDisplayText: "" + (LaTeX[onboardingText]) + ""
useOnboarding: true
layoutCase: 1
layoutHintSolnY: layoutY + Element[{56, 88}, layoutCase]
layoutHintSolnX = Element({If[layoutX ≟ 16, layoutX - 5, 11], layoutX - 5}, layoutCase)
layoutFeedbackX: layoutX + Element[{If[correct ∨ tries ≟ 3, -5, 155], -5}, layoutCase]
layoutFeedbackY = If(correct ∨ tries ≟ 3, 180, 135)
helpTextHint: "" + (LaTeX[If[caseNum ≟ 1, hintCase1, caseNum ≟ 2, hintCase2, hintCase3]]) + ""
textHint: "\textsf{\color{" + (LaTeX[colorOrange]) + "}\bold{Hint}}\\ " + (LaTeX[If[showhinttypicalerror, helpTextHintTypicalError]]) + " " + (LaTeX[If[showhint ∧ showhinttypicalerror, "\\"]]) + "" + (LaTeX[If[showhint, helpTextHint]]) + "}"
pulsingObject = circlePixels(D, 7 + (7 * pulsing), Corner[1], Corner[3], Corner[5])
textCases: "\text{" + (LaTeX[If[caseNum ≟ 1, "is parallel to", caseNum ≟ 2, "is perpendicular to", "intersects"]]) + "}"
solLine = If(caseNum ≟ 1, Line[C, givenLine], caseNum ≟ 2, Line[Midpoint[AF, BF], Vector[UnitOrthogonalVector[givenLine]]], Line[Midpoint[AF, BF], C])
intSolLine: {Intersect[solLine, peep]}
displaySolL = Segment(intSolLine(1), intSolLine(2))
α = If(¬showsolution, Angle[displayGivenL, displayStudL], Angle[displaySolL, displayGivenL])
E: C - (0.5 * UnitVector[displayStudL])
F: D + (0.5 * UnitVector[displayStudL])
versore1 = Segment(C, E)
versore2 = Segment(D, F)
G: AF - (0.5 * UnitVector[givenLine])
H: BF + (0.5 * UnitVector[givenLine])
versore3 = Segment(AF, G)
versore4 = Segment(BF, H)
textQuestion: "\textsf{Drag the points to draw a line}\\
\textsf{that " + (LaTeX[textCases]) + " line } AB " + (LaTeX[If[caseNum ≠ 3, ".", "\textsf{ within}\\\textsf{the activity.}"]]) + " "
isTypicalError: isTypicalError1 ∨ isTypicalError2
tempInputCurrent: {(-4, 5), (4, 5)}
textSolution: "\textsf{\bold{Possible solution}}\\\\" + (LaTeX[If[caseNum ≟ 1, textSolCase1, caseNum ≟ 2, textSolCase2, textSolCase3]]) + ""

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: expandSegment
expandSegment(A,B,pixelGap,Corner1,Corner3,Corner5)
Input: A, B, pixelGap, Corner1, Corner3, Corner5
Output: newPoly

distanceX: (pixelGap / x(Corner5) * (x(Corner3) - x(Corner1)))
distanceY: (pixelGap / y(Corner5) * (y(Corner3) - y(Corner1)))
pointGap: distanceX
xyScale: distanceY / distanceX
A: (0, 0)
vecAB: B - A
pVec: (20 * UnitVector[(((-y(vecAB))) / xyScale, (x(vecAB) * xyScale))])
pVecAngle = Angle(xAxis, Line[(0, 0), pVec])
realAngle = If(pVecAngle ≟ pi / 2 ∨ pVecAngle ≟ (3 * pi / 2), pVecAngle, atand(tan(pVecAngle) / xyScale))
curveFunction = CurveCartesian((pointGap * cos(u)), ((pointGap * xyScale) * sin(u)), u, 0, (2 * pi))
K: curveFunction(realAngle)
vSpace = Vector(K)
allPoints: {A + vSpace, A - vSpace, B - vSpace, B + vSpace}
newPoly = Polygon(allPoints)

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: 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)