forked from Khan/khan-exercises
/
parabola_intuition_2.html
90 lines (80 loc) · 3.09 KB
/
parabola_intuition_2.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
<!DOCTYPE html>
<html data-require="math graphie graphie-helpers">
<head>
<meta charset="UTF-8" />
<title>Parabola intuition 2</title>
<script src="../khan-exercise.js"></script>
<style>
.parabola-answer {
padding: 0;
margin: 10px 0px;
}
.parabola-answer p {
margin: 8px 0px 2px 0px
}
.parabola-answer .mini-buttons {
width: 20px;
display: inline-block;
}
.parabola-answer .mini-buttons input {
margin-left: 5px;
padding: 0px 5px;
width: 20px;
}
</style>
</head>
<body>
<div class="exercise">
<div class="vars">
<var id="A">randRangeNonZero( -2, 2 )</var>
<var id="X1">randRangeNonZero( -5, 5 )</var>
<var id="Y1">randRangeNonZero( -5, 5 )</var>
</div>
<div class="problems">
<div>
<p class="question">Adjust the focus coordinates and the equation of the directrix to make the blue parabola match the orange parabola.</p>
<p>All points on the blue parabola are equidistant from the focus and the directrix. How does changing the numbers affect the shape of the parabola?</p>
<div class="graphie" id="grid">
graphInit({
range: 10,
scale: 20,
tickStep: 1,
axisArrows: "<->"
});
// Plot the orange parabola
style({
stroke: "#FFA500",
fill: "none",
clipRect:[ [-10, -10], [20, 20] ],
arrows: null
});
plot( new Parabola( A, X1, Y1 ).graphieFunction, [-10, 10]);
style({
stroke: "#6495ED",
strokeWidth: 3,
fill: "none",
clipRect:[ [-10, -10], [20, 20] ],
arrows: null
});
graph.currParabola = new Parabola( 1, 0, 0 );
graph.currParabola.plot( true );
</div>
<div class="solution" data-type="multiple">
<p class="parabola-answer">focus x coordinate: <span id="focus-x-label"><code>0</code></span><span class="mini-buttons">
<input type="button" class="simple-button action-gradient" value="+" onclick="updateFocusDirectrix( 1, 0, 0 )" />
<input type="button" class="simple-button action-gradient" value="-" onclick="updateFocusDirectrix( -1, 0, 0 )" /></span></p>
<p class="parabola-answer">focus y coordinate: <span id="focus-y-label"><code>0.25</code></span><span class="mini-buttons">
<input type="button" class="simple-button action-gradient" value="+" onclick="updateFocusDirectrix( 0, 1/8, 0 )" />
<input type="button" class="simple-button action-gradient" value="-" onclick="updateFocusDirectrix( 0, -1/8, 0 )" /></span></p>
<p class="parabola-answer">directrix: <span id="directrix-label"><code>y=-0.25</code></span><span class="mini-buttons">
<input type="button" class="simple-button action-gradient" value="+" onclick="updateFocusDirectrix( 0, 0, 1/8 )" />
<input type="button" class="simple-button action-gradient" value="-" onclick="updateFocusDirectrix( 0, 0, -1/8 )" /></span></p>
<span class="sol" id="leading-coefficient" style="display: none"><var>A</var></span>
<span class="sol" id="vertex-x" style="display: none"><var>X1</var></span>
<span class="sol" id="vertex-y" style="display: none"><var>Y1</var></span>
</div>
</div>
</div>
</div>
</body>
</html>