#4D4D4D

#006758

#B00020

#252525

#757575

#949494

#E44461

#DA2570

#E66B9E

#3A6ED6

#5991FF

#008475

#0F8538

#00a83c

#5145A8

#6557D2

#8575FF

#903D14

#BD6C43

#C75000

#E07415

#eeeeee

#2E006758

#2EB00020

$\text{RESET ZOOM}$

$\text{NEW POINTS}$

\text{Use the controls to zoom the axis and find an appropriate scale for the given points.}

x

y

count = 22
randomSlopes = Shuffle({-0.1, -0.5, -1, -2, -5, -3, 3, 5, 2, 1, 0.5, 0.1})
xinf = -4
randomPointsX = RandomUniform(xinf, (-xinf), 20)
randomDesv = 0.7453536358310959
randomErrors = RandomUniform(0, randomDesv, 20)
randomSlope = Element(randomSlopes, Mod[count, Length[randomSlopes]] + 1)
hZoom = 1 (slider from 0.1 to 5, step 0.1)
vZoom = 1 (slider from 0.1 to 5, step 0.1)
ratioHV: hZoom / vZoom
ratioVH: vZoom / hZoom
guideLine: y = (randomSlope * x)
xMaxStart: 8.25
yMaxStart: 14.4375 / 4
xMax: (xMaxStart * 1 / hZoom)
gridXMin: ((-xMax)) / 3
gridXMax: xMax / 3
yMax: (yMaxStart * 1 / vZoom)
gridYMin: (-16 * yMax / 21)
gridYMax: (16 * yMax / 21)
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)}])
Dims = Corner(5)
graphRegion = Polygon({(gridXMin, gridYMin), (gridXMin, gridYMax), (gridXMax, gridYMax), (gridXMax, gridYMin)})
xMin: ((-xMax)) / 2.5
yMin: (-yMax)
randomPointsY = Zip((randomSlope * (n + ee)), n, randomPointsX, ee, randomErrors)
textVerticalZoom: " " + (LaTeX[(vZoom * 100)]) + " \%"
textHorizontalZoom: " " + (LaTeX[(hZoom * 100)]) + " \%"
randomPoints = Zip((xx, yy), xx, randomPointsX, yy, randomPointsY)
examplePoints = KeepIf(abs(y(PP)) ≤ 20, PP, randomPoints)
maxPointY = Max(y(examplePoints))
minPointY = Min(y(examplePoints))
maxPointX = Max(x(examplePoints))
minPointX = Min(x(examplePoints))
tooVertical: maxPointY > gridYMax ∨ minPointY < gridYMin
tooHorizontal: maxPointX > gridXMax ∨ minPointX < gridXMin
segmentXAxis = Segment((gridXMin + xMax / 500, 0), (gridXMax - xMax / 500, 0))
segmentYAxis = Segment((0, gridYMax - yMax / 100), (0, gridYMin + yMax / 100))
goodV: Max[abs(y(examplePoints))] ≥ yMax / 4
goodX: Max[abs(x(examplePoints))] ≥ xMax / 4
textFeedback: "\text{\bold\textcolor{" + (LaTeX[colorTealSuccess]) + "}{Good Scale}\\This scale seems to show\\
a relationship between the\\
points."
textCaution: "\text{\bold\textcolor{" + (LaTeX[colorOrange]) + "}{Attention}\\
Some points are not shown on\\
the graph at this zoom level"
goodZoom: goodX ∧ goodV ∧ (¬tooHorizontal) ∧ (¬tooVertical)

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)