Skip to content
Fetching contributors…
Cannot retrieve contributors at this time
99 lines (88 sloc) 3.92 KB
<!DOCTYPE html>
<html data-require="math graphie">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Points on the coordinate plane</title>
<script data-main="../local-only/main.js" src="../local-only/require.js"></script>
</head>
<body>
<div class="exercise">
<div class="vars">
<var id="POINTS">
(function() {
var points = [];
while( points.length &lt; 5 ) {
var point = [ randRange( -9, 9 ), randRangeExclude( -9, 9, [-1] ) ];
var isUnique = true;
$.each( points, function( index, pt ) {
if ( point[0] === pt[0] &amp;&amp; point[1] === pt[1] ) {
isUnique = false;
return false;
}
});
if ( isUnique ) {
points.unshift( point );
}
}
return points;
})()
</var>
<var id="FORGOTTEN">randRange( 0, POINTS.length - 1 )</var>
<var id="PAIR">function( arr ) {
return "(" + arr.join( ", " ) + ")";
}</var>
</div>
<div class="problems">
<div>
<div class="problem">
<p>Consider the following coordinate pairs:</p>
<p><code><var>$.map( POINTS, PAIR ).join( "\\qquad" )</var></code></p>
</div>
<div class="question">
<p>Which of those pairs is not graphed below?</p>
<div class="render-answer-area-here"></div>
<div class="graphie" id="grid">
graphInit({
range: 10,
scale: 20,
axisArrows: "&lt;-&gt;",
tickStep: 1,
labelStep: 2
})
$.each( POINTS, function( index, point ) {
if ( index === FORGOTTEN ) {
return;
}
style({
stroke: "#6495ED",
fill: "#6495ED"
}, function() {
circle( point, 0.2 );
});
});
</div>
</div>
<p class="solution"><code><var>PAIR( POINTS[FORGOTTEN] )</var></code></p>
<ul class="choices" data-category="true">
<li data-each="POINTS as i, point"><code><var>PAIR( point )</var></code></li>
</ul>
</div>
</div>
<div class="hints">
<div data-each="POINTS as i, point" data-unwrap="">
<div class="graphie" data-if="FORGOTTEN !== i" data-update="grid">
label( point, PAIR( point ), "above right" );
</div>
</div>
<div>
<div class="graphie" data-update="grid">
var point = POINTS[FORGOTTEN];
label( point, PAIR( point ), "above right", { color: RED });
circle( point, 0.3, { stroke: RED } );
</div>
<p><code>(<var>POINTS[FORGOTTEN]</var>)</code> was not graphed.</p>
</div>
</div>
</div>
</body>
</html>
Jump to Line
Something went wrong with that request. Please try again.