// ------------------------------------- // Live Mathematics and STEM on the Web // Copyright 2019 Compass Learning Technologies // Support: Steve Arnold steve@compasstech.com.au // ------------------------------------- // The following block contains the 5 sets of elements for you to customise... // Step 1. Set your title. // Step 2. Set your introductory text. //====================================================== // 1. Set your topic title here -------------------------- var topic = "GXWeb Sampler"; var shortname = "sampler"; // 2. Set your introductory text (include HTML) -------------------------- var intro = "
" + "©2020 Compass Learning Technologies → Live Mathematics on the Web → Geometry Expressions Assessment Showcase → " + topic + "
" + "" + "" + ""; var gxControl = `" + topic + "
" + " " + "Adapted from New South Wales Higher School Certificate 2005 Mathematics examination, Question 10 (copyright held by NSW Board of Studies).
" + "Two friends agree to meet during their lunch hour, but both are very busy and unsure whether they can make it.
" + "They each agree to wait for 'x' minutes and, if the other has not arrived, to leave.
" + "What is their chance of meeting? Drag the WaitTime point to explore this problem.
" + "Let the unit square describe their lunch hour, and each point (x, y) within that square represent each of our times of arriving.
" + "Then the point (1/2, 2/3) would indicate that I arrived at 12:30, and my friend arrived at 12:40.
" + "How then do the inequalities x - y <= t and y - x <= t describe our chance of meeting?
" + "Points which lie within the shaded hexagon correspond to times of arrival for which we would meet. Points outside the polygon are times for which we would not meet. In fact, our chance of meeting for any wait time, x, will correspond to the AREA of the shaded figure - and the moving point on the screen has coordinates (x, area(x)).
" + "What is the algebraic model that best fits this situation? More simply, what is the formula for the area of the hexagon for any wait time, x?
" + "Try building your own model for this problem using GXweb and use it to explore both the geometry and the algebra involved.
" + "
x =
\\[y = a \\cdot x^2 + b \\cdot x + c\\]a =
b =
c =
` var gxWebCode = `` var gxvid = `
x 0 0 1 a -5 0 5 b -5 0 5 c -5 0 5
Construct your own Model with GXWeb
©2020 Compass Learning Technologies ← Live Mathematics on the Web ← Geometry Expressions Assessment Showcase ← ` + topic + `
` // END elements to change // ---------------------------------------------------- // Do NOT change these remaining elements function setGX(){ var x = document.getElementById("xval").value; document.getElementById("UIINUIx").value = x; document.getElementById("UIx").value = x; var a = document.getElementById("aval").value; document.getElementById("UIINUIa").value = eval(a).toFixed(1); document.getElementById("UIa").value = eval(a).toFixed(1); var b = document.getElementById("bval").value; document.getElementById("UIINUIb").value = eval(b).toFixed(1); document.getElementById("UIb").value = eval(b).toFixed(1); var c = document.getElementById("cval").value; document.getElementById("UIINUIc").value = eval(c).toFixed(1); document.getElementById("UIc").value = eval(c).toFixed(1); var area = eval(2*x-x*x).toFixed(2); document.getElementById("area").innerHTML = "When wait time is " + eval(60*x).toFixed(1) + " minutes, the chance of meeting is approximately " + eval(100*area).toFixed(1) + "%
"; onTime(); } function setupGXW() { document.getElementById("introDiv").innerHTML = intro; document.getElementById("gxCode").innerHTML = gxWebCode; document.getElementById("gxCtrl").innerHTML = gxControl; document.getElementById("gxv").innerHTML = gxvid; } //============================== //Controls hiding and showing sections of text function viewControl(source) { var txt = ""; try{ txt = document.getElementById(source + "Button").textContent;} catch(err){} if (document.getElementById(source).style.display == 'block') { var txt2 = txt.replace(/hide/gi, "Show"); document.getElementById(source).style.display = 'none'; try{ document.getElementById(source + 'Button').textContent = txt2; } catch(err){} } else { var txt1 = txt.replace(/show/gi, "Hide"); document.getElementById(source).style.display = 'block'; try{ document.getElementById(source + 'Button').textContent = txt1; } catch(err){} } try{ MathJax.Hub.Queue(["Typeset",MathJax.Hub]); } catch(err){} } //============================= function setupMQ() { // This sets up the MathQuill entry line, and writes to the f(x) textbox as the function is entered var mathFieldSpan = document.getElementById('fText'); var latexSpan = document.getElementById('myVar_latex'); var mathSpan = document.getElementById('myVar_mtext'); MQ = MathQuill.getInterface(2); // for backcompat mathField = MQ.MathField(mathFieldSpan, { spaceBehavesLikeTab: true, // configurable handlers: { edit: function() { // useful event handlers latexSpan.textContent = mathField.latex(); // simple API mathSpan.textContent = latex2mth(mathField.text()); // simple API var tempf = latex2mth(mathField.text()); tempf = tempf.replace(/\^/gi, "**"); //document.getElementById('UIFf').value = tempf; } } }); } function mqWrite(input) { input = input.replace(/\*\*/gi, "^"); input = input.replace(/\*/gi, ""); document.getElementById('fText').textContent = ""; var mathFieldSpan = document.getElementById('fText'); var latexSpan = document.getElementById('myVar_latex'); var mathSpan = document.getElementById('myVar_mtext'); MQ = MathQuill.getInterface(2); // for backcompat mathField = MQ.MathField(mathFieldSpan, { spaceBehavesLikeTab: true, // configurable handlers: { edit: function() { // useful event handlers latexSpan.textContent = mathField.latex(); // simple API mathSpan.textContent = (mathField.latex()); } } }); mathField.write(input); } // End of preserved elements //----------------------------------------------------