<html>
<head>
<title>Simultaneous linear equations ... The substitution method ... Thanks to https://sydney.edu.au/stuserv/documents/maths_learning_centre/simeqns.pdf</title>
<style>
td { vertical-align: top; }
details { background-color: white; }
#tascratch { background-color: #f9f9f9; }
input { text-align: right; }
</style>
<script>
var y1 = 1.0;
var x1 = 1.0;
var f1 = 0.0;
var y2 = 1.0;
var x2 = 1.0;
var f2 = 0.0;

var thisxintercept=0;
var thisyintercept=0;

var your_y1 = 1.0;
var your_x1 = 1.0;
var your_f1 = 0.0;
var your_y2 = 1.0;
var your_x2 = 1.0;
var your_f2 = 0.0;

var s_w="";
var js_s_w="";

var this_s_w="";
var this_js_s_w="";

var s_w_big="";

function checkyours() {
var tag = document.createElement('script');
tag.innerHTML = document.getElementById('tascratch').value;
var firstScriptTag = document.getElementsByTagName('script')[0];
firstScriptTag.insertAdjacentElement("afterend", tag);
}

function beforepresolve() {
your_x1 = document.getElementById("x1").value;
your_y1 = document.getElementById("y1").value;
your_f1 = document.getElementById("f1").value;
your_x2 = document.getElementById("x2").value;
your_y2 = document.getElementById("y2").value;
your_f2 = document.getElementById("f2").value;
s_w_big='function you_solve_equations() { <br>' + ' thisxintercept = 0; <br>' + ' thisyintercept = 0; <br><br>' + ' your_y1 = ' + your_y1 + '; ';
s_w_big+='<br>' + ' your_x1 = ' + your_x1 + '; ';
s_w_big+='<br>' + ' your_f1 = ' + your_f1 + '; ';
s_w_big+='<br>' + ' your_y2 = ' + your_y2 + '; ';
s_w_big+='<br>' + ' your_x2 = ' + your_x2 + '; ';
s_w_big+='<br>' + ' your_f2 = ' + your_f2 + '; ';

s_w_big+='<br><br> document.getElementById("yans").placeholder="Intersection point is (0,0)"; <br><br> // So you have Javascript variables above to play around with (new ones prefix with "var ") ... <br><br><br><br> // ... hopefully by here you have calculated <br> // thisxintercept and thisyintercept to match the Solve click answer<br><br> if (thisxintercept != 0 || thisyintercept != 0) { <br> var myans="Intersection point is (" + thisxintercept + "," + thisyintercept + ")"; <br> document.getElementById("yans").value=myans;<br> } <br>';


s_w_big+='<br>}<br><br>you_solve_equations(); <br>';

if (!document.getElementById('tascratch')) {
document.getElementById('helpout').innerHTML='<details><summary>Optionally try solving in Javascript scratchpad below ...</summary><textarea cols=95 id=tascratch>' + s_w_big.replace(/\<br\>/g, String.fromCharCode(10)) + '</textarea><br><br><button id=yourcheck onclick=checkyours(); style=background-color:lightgreen;>Check Working Above ...</button>&nbsp;&nbsp;<input id=yans type=text placeholder="Intersection point is (0,0)" value="" style=width:70%;></input><br></details><br>';
} else {
document.getElementById('tascratch').value=s_w_big.replace(/\<br\>/g, String.fromCharCode(10));
document.getElementById('yans').value='';
}

document.getElementById('tascratch').rows=eval(1 + eval('' + s_w_big.split('<br>').length));

s_w_big="";
}

function presolve() {

s_w="";
js_s_w="";

this_s_w="";
this_js_s_w="";

s_w_big="";

}

function init() {
if (window.location.search.indexOf("x1") != (0 - 1)) {
var myprmstr = window.location.search.substr(1);
var myprmarr = myprmstr.split ("&");
var myparams = {};
var eis = "";


for ( var i = 0; i < myprmarr.length; i++) {
var mytmparr = myprmarr[i].split("=");
myparams[mytmparr[0]] = mytmparr[1];
eis = mytmparr[0] + " = ";
eis = eis + mytmparr[1];
//alert(eis);
//eval(eis);
document.getElementById(mytmparr[0]).value = mytmparr[1];
}
//alert(stuff);
document.forms[0].onsubmit = function() { presolve(); return solve_equations(); }
} else {
document.forms[0].onsubmit = function() { presolve(); return solve_equations(); }
}

}


function ee1x(ee1y) {
var xis=0.0;
this_s_w=" var xis=0.0; ";
this_js_s_w=" /" + "/ function ee1x(ee1y<sup>=" + ee1y + "</sup>) { var xis=0.0; ";
s_w+='<br>' + this_s_w;
js_s_w+='<br>' + this_js_s_w;
s_w_big+='<br>' + this_s_w + '<font color=#f0f0f0;> // </font><font color=magenta>' + this_js_s_w.split('// ')[eval(-1 + this_js_s_w.split('// ').length)] + '</font>';
var fis=0.0;
this_s_w=" var fis=0.0; ";
this_js_s_w=" /" + "/ var fis=0.0; ";
s_w+='<br>' + this_s_w;
js_s_w+='<br>' + this_js_s_w;
s_w_big+='<br>' + this_s_w + '<font color=#f0f0f0;> // </font><font color=magenta>' + this_js_s_w.split('// ')[eval(-1 + this_js_s_w.split('// ').length)] + '</font>';
// (y1)y=(x1)x + f1;
xis = eval(xis+(y1));
this_s_w=" xis=" + xis + "; ";
this_js_s_w=" /" + "/ xis = eval(xis+(y1)); ";
s_w+='<br>' + this_s_w;
js_s_w+='<br>' + this_js_s_w;
s_w_big+='<br>' + this_s_w + '<font color=#f0f0f0;> // </font><font color=magenta>' + this_js_s_w.split('// ')[eval(-1 + this_js_s_w.split('// ').length)] + '</font>';
xis *= ee1y;
this_s_w=" xis=" + xis + "; ";
this_js_s_w=" /" + "/ xis *= ee1y; ";
s_w+='<br>' + this_s_w;
js_s_w+='<br>' + this_js_s_w;
s_w_big+='<br>' + this_s_w + '<font color=#f0f0f0;> // </font><font color=magenta>' + this_js_s_w.split('// ')[eval(-1 + this_js_s_w.split('// ').length)] + '</font>';
xis = eval((xis)-(f1));
this_s_w=" xis=" + xis + "; ";
this_js_s_w=" /" + "/ xis = eval((xis)-(f1)); ";
s_w+='<br>' + this_s_w;
js_s_w+='<br>' + this_js_s_w;
s_w_big+='<br>' + this_s_w + '<font color=#f0f0f0;> // </font><font color=magenta>' + this_js_s_w.split('// ')[eval(-1 + this_js_s_w.split('// ').length)] + '</font>';
xis /= x1;
this_s_w=" xis=" + xis + "; ";
this_js_s_w=" /" + "/ xis /= x1; return xis; } ";
s_w+='<br>' + this_s_w;
js_s_w+='<br>' + this_js_s_w;
s_w_big+='<br>' + this_s_w + '<font color=#f0f0f0;> // </font><font color=magenta>' + this_js_s_w.split('// ')[eval(-1 + this_js_s_w.split('// ').length)] + '</font>';
return xis;
}

function ee2x(ee2y) {
var xis=0.0;
this_s_w=" var xis=0.0; ";
this_js_s_w=" /" + "/ function ee2x(ee2y<sup>=" + ee2y + "</sup>) { var xis=0.0; ";
s_w+='<br>' + this_s_w;
js_s_w+='<br>' + this_js_s_w;
s_w_big+='<br>' + this_s_w + '<font color=#f0f0f0;> // </font><font color=magenta>' + this_js_s_w.split('// ')[eval(-1 + this_js_s_w.split('// ').length)] + '</font>';
var fis=0.0;
this_s_w=" var fis=0.0; ";
this_js_s_w=" /" + "/ var fis=0.0; ";
s_w+='<br>' + this_s_w;
js_s_w+='<br>' + this_js_s_w;
s_w_big+='<br>' + this_s_w + '<font color=#f0f0f0;> // </font><font color=magenta>' + this_js_s_w.split('// ')[eval(-1 + this_js_s_w.split('// ').length)] + '</font>';
// (y2)y=(x2)x + f2;
xis = eval(xis+(y2));
this_s_w=" xis=" + xis + "; ";
this_js_s_w=" /" + "/ xis = eval(xis+(y2)); ";
s_w+='<br>' + this_s_w;
js_s_w+='<br>' + this_js_s_w;
s_w_big+='<br>' + this_s_w + '<font color=#f0f0f0;> // </font><font color=magenta>' + this_js_s_w.split('// ')[eval(-1 + this_js_s_w.split('// ').length)] + '</font>';
xis *= ee2y;
this_s_w=" xis=" + xis + "; ";
this_js_s_w=" /" + "/ xis *= ee2y; ";
s_w+='<br>' + this_s_w;
js_s_w+='<br>' + this_js_s_w;
s_w_big+='<br>' + this_s_w + '<font color=#f0f0f0;> // </font><font color=magenta>' + this_js_s_w.split('// ')[eval(-1 + this_js_s_w.split('// ').length)] + '</font>';
xis = eval((xis)-(f2));
this_s_w=" xis=" + xis + "; ";
this_js_s_w=" /" + "/ xis = eval((xis)-(f2)); ";
s_w+='<br>' + this_s_w;
js_s_w+='<br>' + this_js_s_w;
s_w_big+='<br>' + this_s_w + '<font color=#f0f0f0;> // </font><font color=magenta>' + this_js_s_w.split('// ')[eval(-1 + this_js_s_w.split('// ').length)] + '</font>';
xis /= x2;
this_s_w=" xis=" + xis + "; ";
this_js_s_w=" /" + "/ xis /= x2; return xis; } ";
s_w+='<br>' + this_s_w;
js_s_w+='<br>' + this_js_s_w;
s_w_big+='<br>' + this_s_w + '<font color=#f0f0f0;> // </font><font color=magenta>' + this_js_s_w.split('// ')[eval(-1 + this_js_s_w.split('// ').length)] + '</font>';
return xis;
}


function e1y(e1x) {
var yis=0.0;
this_s_w=" var yis=0.0; ";
this_js_s_w=" /" + "/ function e1y(e1x<sup>=" + e1x + "</sup>) { var yis=0.0; ";
s_w+='<br>' + this_s_w;
js_s_w+='<br>' + this_js_s_w;
s_w_big+='<br>' + this_s_w + '<font color=#f0f0f0;> // </font><font color=magenta>' + this_js_s_w.split('// ')[eval(-1 + this_js_s_w.split('// ').length)] + '</font>';
var fis=0.0;
this_s_w=" var fis=0.0; ";
this_js_s_w=" /" + "/ var fis=0.0; ";
s_w+='<br>' + this_s_w;
js_s_w+='<br>' + this_js_s_w;
s_w_big+='<br>' + this_s_w + '<font color=#f0f0f0;> // </font><font color=magenta>' + this_js_s_w.split('// ')[eval(-1 + this_js_s_w.split('// ').length)] + '</font>';
yis = eval(yis+(x1)); //eval(((x1) * (xis)) + (f1));
this_s_w=" yis=" + yis + "; ";
this_js_s_w=" /" + "/ yis = eval(yis+(x1)); ";
s_w+='<br>' + this_s_w;
js_s_w+='<br>' + this_js_s_w;
s_w_big+='<br>' + this_s_w + '<font color=#f0f0f0;> // </font><font color=magenta>' + this_js_s_w.split('// ')[eval(-1 + this_js_s_w.split('// ').length)] + '</font>';
//alert('yis 1 = eval((x1 * xis) + (f1)) = ' + yis);
yis *= e1x;
this_s_w=" yis=" + yis + "; ";
this_js_s_w=" /" + "/ yis *= e1x; ";
s_w+='<br>' + this_s_w;
js_s_w+='<br>' + this_js_s_w;
s_w_big+='<br>' + this_s_w + '<font color=#f0f0f0;> // </font><font color=magenta>' + this_js_s_w.split('// ')[eval(-1 + this_js_s_w.split('// ').length)] + '</font>';
//alert('yis 2 = eval((x1 * xis) + (f1)) = ' + yis);
fis = eval((fis)+(f1));
this_s_w=" fis=" + fis + "; ";
this_js_s_w=" /" + "/ fis = eval((fis)+(f1)); ";
s_w+='<br>' + this_s_w;
js_s_w+='<br>' + this_js_s_w;
s_w_big+='<br>' + this_s_w + '<font color=#f0f0f0;> // </font><font color=magenta>' + this_js_s_w.split('// ')[eval(-1 + this_js_s_w.split('// ').length)] + '</font>';
yis = eval((yis)+(fis));
this_s_w=" yis=" + yis + "; ";
this_js_s_w=" /" + "/ yis = eval((yis)+(fis)); return yis; } ";
s_w+='<br>' + this_s_w;
js_s_w+='<br>' + this_js_s_w;
s_w_big+='<br>' + this_s_w + '<font color=#f0f0f0;> // </font><font color=magenta>' + this_js_s_w.split('// ')[eval(-1 + this_js_s_w.split('// ').length)] + '</font>';
return yis;
}

function e2y(e2x) {
var yis=0.0;
this_s_w=" var yis=0.0; ";
this_js_s_w=" /" + "/ function e2y(e2x<sup>=" + e2x + "</sup>) { var yis=0.0; "
s_w+='<br>' + this_s_w;
js_s_w+='<br>' + this_js_s_w;
s_w_big+='<br>' + this_s_w + '<font color=#f0f0f0;> // </font><font color=magenta>' + this_js_s_w.split('// ')[eval(-1 + this_js_s_w.split('// ').length)] + '</font>';
var fis=0.0;
this_s_w=" var fis=0.0; ";
this_js_s_w=" /" + "/ var fis=0.0; ";
s_w+='<br>' + this_s_w;
js_s_w+='<br>' + this_js_s_w;
s_w_big+='<br>' + this_s_w + '<font color=#f0f0f0;> // </font><font color=magenta>' + this_js_s_w.split('// ')[eval(-1 + this_js_s_w.split('// ').length)] + '</font>';
yis = eval(yis+(x2)); //eval(((x1) * (xis)) + (f1));
this_s_w=" yis=" + yis + "; ";
this_js_s_w=" /" + "/ yis = eval(yis+(x2)); ";
s_w+='<br>' + this_s_w;
js_s_w+='<br>' + this_js_s_w;
s_w_big+='<br>' + this_s_w + '<font color=#f0f0f0;> // </font><font color=magenta>' + this_js_s_w.split('// ')[eval(-1 + this_js_s_w.split('// ').length)] + '</font>';
//alert('yis 1 = eval((x1 * xis) + (f1)) = ' + yis);
yis *= e2x;
this_s_w=" yis=" + yis + "; ";
this_js_s_w=" /" + "/ yis *= e2x; ";
s_w+='<br>' + this_s_w;
js_s_w+='<br>' + this_js_s_w;
s_w_big+='<br>' + this_s_w + '<font color=#f0f0f0;> // </font><font color=magenta>' + this_js_s_w.split('// ')[eval(-1 + this_js_s_w.split('// ').length)] + '</font>';
//alert('yis 2 = eval((x1 * xis) + (f1)) = ' + yis);
fis = eval((fis)+(f2));
this_s_w=" fis=" + fis + "; ";
this_js_s_w=" /" + "/ fis = eval((fis)+(f2)); ";
s_w+='<br>' + this_s_w;
js_s_w+='<br>' + this_js_s_w;
s_w_big+='<br>' + this_s_w + '<font color=#f0f0f0;> // </font><font color=magenta>' + this_js_s_w.split('// ')[eval(-1 + this_js_s_w.split('// ').length)] + '</font>';
yis = eval((yis)+(fis));
this_s_w=" yis=" + yis + "; ";
this_js_s_w=" /" + "/ yis = eval((yis)+(fis)); return yis; } ";
s_w+='<br>' + this_s_w;
js_s_w+='<br>' + this_js_s_w;
s_w_big+='<br>' + this_s_w + '<font color=#f0f0f0;> // </font><font color=magenta>' + this_js_s_w.split('// ')[eval(-1 + this_js_s_w.split('// ').length)] + '</font>';
return yis;
}

function mixitup() {
document.getElementById("x1").value='' + Math.floor(Math.random() * 19) - Math.floor(Math.random() * 19);
document.getElementById("y1").value='' + Math.floor(Math.random() * 19) - Math.floor(Math.random() * 19);
document.getElementById("f1").value='' + Math.floor(Math.random() * 19) - Math.floor(Math.random() * 19);
document.getElementById("x2").value='' + Math.floor(Math.random() * 19) - Math.floor(Math.random() * 19);
document.getElementById("y2").value='' + Math.floor(Math.random() * 19) - Math.floor(Math.random() * 19);
document.getElementById("f2").value='' + Math.floor(Math.random() * 19) - Math.floor(Math.random() * 19);
beforepresolve();
}

function solve_equations() {
var xis=0.0;
this_s_w=" var xis=0.0; ";
this_js_s_w=" /" + "/ function solve_equations() { var xis=0.0; "
s_w+='<br>' + this_s_w;
js_s_w+='<br>' + this_js_s_w;
s_w_big+='<br>' + this_s_w + '<font color=#f0f0f0;> // </font><font color=magenta>' + this_js_s_w.split('// ')[eval(-1 + this_js_s_w.split('// ').length)] + '</font>';
var fis=0.0;
this_s_w=" var fis=0.0; ";
this_js_s_w=" /" + "/ var fis=0.0; ";
s_w+='<br>' + this_s_w;
js_s_w+='<br>' + this_js_s_w;
s_w_big+='<br>' + this_s_w + '<font color=#f0f0f0;> // </font><font color=magenta>' + this_js_s_w.split('// ')[eval(-1 + this_js_s_w.split('// ').length)] + '</font>';
x1 = document.getElementById("x1").value;
this_s_w=" x1 = " + x1 + "; ";
this_js_s_w=" /" + "/ x1 = document.getElementById(\"x1\").value; ";
s_w+='<br>' + this_s_w;
js_s_w+='<br>' + this_js_s_w;
s_w_big+='<br>' + this_s_w + '<font color=#f0f0f0;> // </font><font color=magenta>' + this_js_s_w.split('// ')[eval(-1 + this_js_s_w.split('// ').length)] + '</font>';
y1 = document.getElementById("y1").value;
this_s_w=" y1 = " + y1 + "; ";
this_js_s_w=" /" + "/ y1 = document.getElementById(\"y1\").value; ";
s_w+='<br>' + this_s_w;
js_s_w+='<br>' + this_js_s_w;
s_w_big+='<br>' + this_s_w + '<font color=#f0f0f0;> // </font><font color=magenta>' + this_js_s_w.split('// ')[eval(-1 + this_js_s_w.split('// ').length)] + '</font>';
f1 = document.getElementById("f1").value;
this_s_w=" f1 = " + f1 + "; ";
this_js_s_w=" /" + "/ f1 = document.getElementById(\"f1\").value; ";
s_w+='<br>' + this_s_w;
js_s_w+='<br>' + this_js_s_w;
s_w_big+='<br>' + this_s_w + '<font color=#f0f0f0;> // </font><font color=magenta>' + this_js_s_w.split('// ')[eval(-1 + this_js_s_w.split('// ').length)] + '</font>';
x2 = document.getElementById("x2").value;
this_s_w=" x2 = " + x2 + "; ";
this_js_s_w=" /" + "/ x2 = document.getElementById(\"x2\").value; ";
s_w+='<br>' + this_s_w;
js_s_w+='<br>' + this_js_s_w;
s_w_big+='<br>' + this_s_w + '<font color=#f0f0f0;> // </font><font color=magenta>' + this_js_s_w.split('// ')[eval(-1 + this_js_s_w.split('// ').length)] + '</font>';
y2 = document.getElementById("y2").value;
this_s_w=" y2 = " + y2 + "; ";
this_js_s_w=" /" + "/ y2 = document.getElementById(\"y2\").value; ";
s_w+='<br>' + this_s_w;
js_s_w+='<br>' + this_js_s_w;
s_w_big+='<br>' + this_s_w + '<font color=#f0f0f0;> // </font><font color=magenta>' + this_js_s_w.split('// ')[eval(-1 + this_js_s_w.split('// ').length)] + '</font>';
f2 = document.getElementById("f2").value;
this_s_w=" f2 = " + f2 + "; ";
this_js_s_w=" /" + "/ f2 = document.getElementById(\"f2\").value; ";
s_w+='<br>' + this_s_w;
js_s_w+='<br>' + this_js_s_w;
s_w_big+='<br>' + this_s_w + '<font color=#f0f0f0;> // </font><font color=magenta>' + this_js_s_w.split('// ')[eval(-1 + this_js_s_w.split('// ').length)] + '</font>';
var iurl = "//www.rjmprogramming.com.au/PHP/LineChart/line_chart.php?title=Simultaneous%20Linear%20Equations&onclick=y&label=x&value=";
this_s_w=" var iurl = \"" + iurl + "\"; ";
this_js_s_w=" /" + "/ var iurl = \"//www.rjmprogramming.com.au/PHP/LineChart/line_chart.php?title=Simultaneous%20Linear%20Equations&onclick=y&label=x&value=\"; ";
s_w+='<br>' + this_s_w;
js_s_w+='<br>' + this_js_s_w;
s_w_big+='<br>' + this_s_w + '<font color=#f0f0f0;> // </font><font color=magenta>' + this_js_s_w.split('// ')[eval(-1 + this_js_s_w.split('// ').length)] + '</font>';
iurl = iurl + y1 + "y%3d" + x1 + "x%2b(" + f1 + ")," + y2 + "y%3d" + x2 + "x%2b(" + f2 + ")&data=";
this_s_w=" iurl = \"" + iurl + "\"; ";
this_js_s_w=" /" + "/ iurl = iurl + y1 + \"y%3d\" + x1 + \"x%2b(\" + f1 + \"),\" + y2 + \"y%3d\" + x2 + \"x%2b(\" + f2 + \")&data=\"; ";
s_w+='<br>' + this_s_w;
js_s_w+='<br>' + this_js_s_w;
s_w_big+='<br>' + this_s_w + '<font color=#f0f0f0;> // </font><font color=magenta>' + this_js_s_w.split('// ')[eval(-1 + this_js_s_w.split('// ').length)] + '</font>';

if (y1 != 1) {
x1 = x1 / y1;
this_s_w=" x1 = " + x1 + "; ";
this_js_s_w=" /" + "/ if (y1<sup>=" + y1 + "</sup> != 1) { x1 = x1 / y1; ";
s_w+='<br>' + this_s_w;
js_s_w+='<br>' + this_js_s_w;
s_w_big+='<br>' + this_s_w + '<font color=#f0f0f0;> // </font><font color=magenta>' + this_js_s_w.split('// ')[eval(-1 + this_js_s_w.split('// ').length)] + '</font>';
f1 = f1 / y1;
this_s_w=" f1 = " + f1 + "; ";
this_js_s_w=" /" + "/ f1 = f1 / y1; ";
s_w+='<br>' + this_s_w;
js_s_w+='<br>' + this_js_s_w;
s_w_big+='<br>' + this_s_w + '<font color=#f0f0f0;> // </font><font color=magenta>' + this_js_s_w.split('// ')[eval(-1 + this_js_s_w.split('// ').length)] + '</font>';
y1 = 1.0;
this_s_w=" y1 = 1.0; ";
this_js_s_w=" /" + "/ y1 = 1.0; } ";
s_w+='<br>' + this_s_w;
js_s_w+='<br>' + this_js_s_w;
s_w_big+='<br>' + this_s_w + '<font color=#f0f0f0;> // </font><font color=magenta>' + this_js_s_w.split('// ')[eval(-1 + this_js_s_w.split('// ').length)] + '</font>';
}
if (y2 != 1) {
x2 = x2 / y2;
this_s_w=" x2 = " + x2 + "; ";
this_js_s_w=" /" + "/ if (y2<sup>=" + y2 + "</sup> != 1) { x2 = x2 / y2; ";
s_w+='<br>' + this_s_w;
js_s_w+='<br>' + this_js_s_w;
s_w_big+='<br>' + this_s_w + '<font color=#f0f0f0;> // </font><font color=magenta>' + this_js_s_w.split('// ')[eval(-1 + this_js_s_w.split('// ').length)] + '</font>';
f2 = f2 / y2;
this_s_w=" f2 = " + f2 + "; ";
this_js_s_w=" /" + "/ f2 = f2 / y2; ";
s_w+='<br>' + this_s_w;
js_s_w+='<br>' + this_js_s_w;
s_w_big+='<br>' + this_s_w + '<font color=#f0f0f0;> // </font><font color=magenta>' + this_js_s_w.split('// ')[eval(-1 + this_js_s_w.split('// ').length)] + '</font>';
y2 = 1.0;
this_s_w=" y2 = 1.0; ";
this_js_s_w=" /" + "/ y2 = 1.0; } ";
s_w+='<br>' + this_s_w;
js_s_w+='<br>' + this_js_s_w;
s_w_big+='<br>' + this_s_w + '<font color=#f0f0f0;> // </font><font color=magenta>' + this_js_s_w.split('// ')[eval(-1 + this_js_s_w.split('// ').length)] + '</font>';
}

var xx1 = eval((x1) - (x2));
this_s_w=" var xx1 = " + xx1 + "; ";
this_js_s_w=" /" + "/ eval((x1) - (x2)); ";
s_w+='<br>' + this_s_w;
js_s_w+='<br>' + this_js_s_w;
s_w_big+='<br>' + this_s_w + '<font color=#f0f0f0;> // </font><font color=magenta>' + this_js_s_w.split('// ')[eval(-1 + this_js_s_w.split('// ').length)] + '</font>';
//alert('xx1 = eval((x1) - (x2)) = ' + xx1);
var ff1 = eval((f2) - (f1));
this_s_w=" var ff1 = " + ff1 + "; ";
this_js_s_w=" /" + "/ var ff1 = eval((f2) - (f1)); ";
s_w+='<br>' + this_s_w;
js_s_w+='<br>' + this_js_s_w;
s_w_big+='<br>' + this_s_w + '<font color=#f0f0f0;> // </font><font color=magenta>' + this_js_s_w.split('// ')[eval(-1 + this_js_s_w.split('// ').length)] + '</font>';
//alert('ff1 = eval((f2) - (f1)) = ' + ff1);
var xis = eval((ff1) / (xx1));
this_s_w=" var xis = " + xis + "; ";
this_js_s_w=" /" + "/ var xis = eval((ff1) / (xx1)); ";
s_w+='<br>' + this_s_w;
js_s_w+='<br>' + this_js_s_w;
s_w_big+='<br>' + this_s_w + '<font color=#f0f0f0;> // </font><font color=magenta>' + this_js_s_w.split('// ')[eval(-1 + this_js_s_w.split('// ').length)] + '</font>';
//alert('xis = eval(ff1 / xx1) = ' + xis);

//yis = eval(yis+(x1)); //eval(((x1) * (xis)) + (f1));
////alert('yis 1 = eval((x1 * xis) + (f1)) = ' + yis);
//yis *= xis;
////alert('yis 2 = eval((x1 * xis) + (f1)) = ' + yis);
//fis = eval((fis)+(f1));
//yis = eval((yis)+(fis));
////alert('yis 3 = eval((x1 * xis) + (f1)) = ' + yis);

yis = e1y(xis);
this_s_w=" yis = " + yis + "; ";
this_js_s_w=" /" + "/ yis = e1y(xis); ";
s_w+='<br>' + this_s_w;
js_s_w+='<br>' + this_js_s_w;
s_w_big+='<br>' + this_s_w + '<font color=#f0f0f0;> // </font><font color=magenta>' + this_js_s_w.split('// ')[eval(-1 + this_js_s_w.split('// ').length)] + '</font>';


//http://localhost:8888/line_chart.php?title=Simultaneous%20Equations&label=x&value=x,y&data=,[-1.0,0,6],[0.0,2,5],[1.0,4,4],[5.0,12,0]
var xxis=ee1x(0.0);
this_s_w=" var xxis = " + xxis + "; ";
this_js_s_w=" /" + "/ var xxis=ee1x(0.0); ";
s_w+='<br>' + this_s_w;
js_s_w+='<br>' + this_js_s_w;
s_w_big+='<br>' + this_s_w + '<font color=#f0f0f0;> // </font><font color=magenta>' + this_js_s_w.split('// ')[eval(-1 + this_js_s_w.split('// ').length)] + '</font>';

var yyis=e2y(xxis);
this_s_w=" var yyis = " + yyis + "; ";
this_js_s_w=" /" + "/ var yyis=e2y(xxis); ";
s_w+='<br>' + this_s_w;
js_s_w+='<br>' + this_js_s_w;
s_w_big+='<br>' + this_s_w + '<font color=#f0f0f0;> // </font><font color=magenta>' + this_js_s_w.split('// ')[eval(-1 + this_js_s_w.split('// ').length)] + '</font>';

iurl = iurl + ",[" + xxis + ",0.0," + yyis + "]";
this_s_w=" iurl = \"" + iurl + "\"; ";
this_js_s_w=" /" + "/ iurl = iurl + \",[\" + xxis + \",0.0,\" + yyis + \"]\"; ";
s_w+='<br>' + this_s_w;
js_s_w+='<br>' + this_js_s_w;
s_w_big+='<br>' + this_s_w + '<font color=#f0f0f0;> // </font><font color=magenta>' + this_js_s_w.split('// ')[eval(-1 + this_js_s_w.split('// ').length)] + '</font>';

yyis = e1y(0.0);
this_s_w=" yyis = " + yyis + "; ";
this_js_s_w=" /" + "/ yyis = e1y(0.0); ";
s_w+='<br>' + this_s_w;
js_s_w+='<br>' + this_js_s_w;
s_w_big+='<br>' + this_s_w + '<font color=#f0f0f0;> // </font><font color=magenta>' + this_js_s_w.split('// ')[eval(-1 + this_js_s_w.split('// ').length)] + '</font>';

iurl = iurl + ",[0.0," + yyis + "," + e2y(0.0) + "]";
this_s_w=" iurl = \"" + iurl + "\"; ";
this_js_s_w=" /" + "/ iurl = iurl + \",[0.0,\" + yyis + \",\" + e2y(0.0) + \"]\"; ";
s_w+='<br>' + this_s_w;
js_s_w+='<br>' + this_js_s_w;
s_w_big+='<br>' + this_s_w + '<font color=#f0f0f0;> // </font><font color=magenta>' + this_js_s_w.split('// ')[eval(-1 + this_js_s_w.split('// ').length)] + '</font>';

iurl = iurl + ",[" + xis + "," + yis + "," + yis + "]";
this_s_w=" iurl = \"" + iurl + "\"; ";
this_js_s_w=" /" + "/ iurl = iurl + \",[\" + xis + \",\" + yis + \",\" + yis + \"]\"; ";
s_w+='<br>' + this_s_w;
js_s_w+='<br>' + this_js_s_w;
s_w_big+='<br>' + this_s_w + '<font color=#f0f0f0;> // </font><font color=magenta>' + this_js_s_w.split('// ')[eval(-1 + this_js_s_w.split('// ').length)] + '</font>';

xxis = ee2x(0.0);
this_s_w=" xxis = " + xxis + "; ";
this_js_s_w=" /" + "/ xxis = ee2x(0.0); ";
s_w+='<br>' + this_s_w;
js_s_w+='<br>' + this_js_s_w;
s_w_big+='<br>' + this_s_w + '<font color=#f0f0f0;> // </font><font color=magenta>' + this_js_s_w.split('// ')[eval(-1 + this_js_s_w.split('// ').length)] + '</font>';

yyis = e1y(xxis);
this_s_w=" yyis = " + yyis + "; ";
this_js_s_w=" /" + "/ yyis = e1y(xxis); ";
s_w+='<br>' + this_s_w;
js_s_w+='<br>' + this_js_s_w;
s_w_big+='<br>' + this_s_w + '<font color=#f0f0f0;> // </font><font color=magenta>' + this_js_s_w.split('// ')[eval(-1 + this_js_s_w.split('// ').length)] + '</font>';

iurl = iurl + ",[" + xxis + "," + yyis + ",0.0]";
this_s_w=" iurl = \"" + iurl + "\"; ";
this_js_s_w=" /" + "/ iurl = iurl + \",[\" + xxis + \",\" + yyis + \",0.0]\"; ";
s_w+='<br>' + this_s_w;
js_s_w+='<br>' + this_js_s_w;
s_w_big+='<br>' + this_s_w + '<font color=#f0f0f0;> // </font><font color=magenta>' + this_js_s_w.split('// ')[eval(-1 + this_js_s_w.split('// ').length)] + '</font>';

var qwt=document.getElementById('ifrm');
this_s_w=" ";
this_js_s_w=" /" + "/ var qwt=document.getElementById('ifrm'); ";
s_w+='<br>' + this_s_w;
js_s_w+='<br>' + this_js_s_w;
s_w_big+='<br>' + this_s_w + '<font color=#f0f0f0;> // </font><font color=magenta>' + this_js_s_w.split('// ')[eval(-1 + this_js_s_w.split('// ').length)] + '</font>';

qwt.style.display = 'block';
this_s_w=" ";
this_js_s_w=" /" + "/ qwt.style.display = 'block'; ";
s_w+='<br>' + this_s_w;
js_s_w+='<br>' + this_js_s_w;
s_w_big+='<br>' + this_s_w + '<font color=#f0f0f0;> // </font><font color=magenta>' + this_js_s_w.split('// ')[eval(-1 + this_js_s_w.split('// ').length)] + '</font>';

if (1 == 1) {

qwt.src = iurl.split('rjmprogramming.com.au')[1];
this_s_w=" ";
this_js_s_w=" /" + "/ qwt.src = iurl.split('rjmprogramming.com.au')[1]; ";
s_w+='<br>' + this_s_w;
js_s_w+='<br>' + this_js_s_w;
s_w_big+='<br>' + this_s_w + '<font color=#f0f0f0;> // </font><font color=magenta>' + this_js_s_w.split('// ')[eval(-1 + this_js_s_w.split('// ').length)] + '</font>';

ouralert('Intersection point is (' + xis + ',' + yis + ')');
} else {
window.open(iurl, 'ifrm');
qwt.src = iurl;
ouralert('Intersection point is (' + xis + ',' + yis + ')');
}
//var xxx=prompt("", iurl);

this_s_w=" ";
this_js_s_w=" /" + "/ return false; } ";
s_w+='<br>' + this_s_w;
js_s_w+='<br>' + this_js_s_w;
s_w_big+='<br>' + this_s_w + '<font color=#f0f0f0;> // </font><font color=magenta>' + this_js_s_w.split('// ')[eval(-1 + this_js_s_w.split('// ').length)] + '</font>';

document.getElementById('tdright').innerHTML='<details style=display:NONE; id=d_s_w><summary id=s_s_w>Show working based on Substitution Method ...</summary>' + s_w + '</details>&nbsp;<details style=display:NONE; id=d_js_s_w><summary id=s_js_s_w>Javascript ...</summary>' + js_s_w + '</details>&nbsp;<details style=display:inline-block; id=d_s_w_big><summary id=s_s_w_big>Show working based on Substitution Method ... Both calculations and <font color=magenta>Javascript</font> ...</summary>' + s_w_big + '</details>';

return false; //true
}

function ouralert(inid) {
if (inid.indexOf('NaN') == -1) {
this_s_w=" ";
this_js_s_w=" /" + "/ alert(\"" + inid + "\"); ";
s_w+='<br>' + this_s_w;
js_s_w+='<br>' + this_js_s_w;
s_w_big+='<br>' + this_s_w + '<font color=#f0f0f0;> // </font><font color=magenta>' + this_js_s_w.split('// ')[eval(-1 + this_js_s_w.split('// ').length)] + '</font>';

setTimeout(function(){ alert(inid); }, 1000);
}
}

</script>
</head>
<body onload="mixitup(); init();" style="background-color: yellow;">
<form style="border: 5px solid blue; padding: 4px 4px 4px 4px;" method="GET">
<table>
<tr><td>
<h2>Your Simultaneous Linear Equations</h2>
<h3>RJM Programming - November, 2013</h3>
<h4>Thanks to <a target=_blank title='https://sydney.edu.au/stuserv/documents/maths_learning_centre/simeqns.pdf' href='//sydney.edu.au/stuserv/documents/maths_learning_centre/simeqns.pdf'>https://sydney.edu.au/stuserv/documents/maths_learning_centre/simeqns.pdf</a></h4>
<p><label><input type="text" id="y1" name="y1" value="1" /> y = <input type="text" id="x1" name="x1" value="1" /> x + (<input type="text" id="f1" name="f1" value="0" />)</label></p>
<p><label><input type="text" id="y2" name="y2" value="1" /> y = <input type="text" id="x2" name="x2" value="1" /> x + (<input type="text" id="f2" name="f2" value="0" />)</label></p>
<p><input onclick="setTimeout(beforepresolve,2000);" id="r" type="reset" />&nbsp;<input onclick=mixitup(); style=background-color:cyan;color:purple; type="button" value=Suggest></input>&nbsp;<input style=background-color:orange;color:blue; type="submit" id="s" value="Solve" /></p>
</form></td><td id=td_right><div id=helpout></div><div id=tdright></div></td></tr></table>
<br>
<hr>
<iframe src="javascript:false;" name="ifrm" id="ifrm" style="display:none;width:100%;height:600px;"></iframe>
</body>
</html>