examples/solver.js
function solveLinearIntersect(a,b, c,  d,e, f) {
	// ax + by = c;
	// dx + ey = d;
	console.log('WORKED: ', arguments);
	if(a === 0) {
		var y = c/b;
		var x = (d-e*y)/x;
		return [x, y];
	}
	var denom = e-d/a * b;
	if(denom === 0) {
		// Either infinite solutions or no solutions
		return [undefined, undefined];
	}
	var y = (f-d*c/a)/denom;
	var x = (c-b*y) / a;
	return [x, y];
}
function solveLinearIntersect(a,b, c,  d,e, f) {
	// ax + by = c;
	// dx + ey = d;
	console.log('WORKED: ', arguments);
	if(a === 0) {
		var y = c/b;
		var x = (d-e*y)/x;
		return [x, y];
	}
	var denom = e-d/a * b;
	if(denom === 0) {
		// Either infinite solutions or no solutions
		return [undefined, undefined];
	}
	var y = (f-d*c/a)/denom;
	var x = (c-b*y) / a;
	return [x, y];
}
function solveLinearIntersect ( a , b , c , d , e , f ) { // ax + by = c; // dx + ey = d; console . log ( 'WORKED: ' , arguments ) ; if ( a === 0 ) { var y = c / b ; var x = ( d - e * y ) / x ; return [ x , y ] ; } var denom = e - d / a * b ; if ( denom === 0 ) { // Either infinite solutions or no solutions return [ undefined , undefined ] ; } var y = ( f - d * c / a ) / denom ; var x = ( c - b * y ) / a ; return [ x , y ] ; }
Does not work!!!, but a general idea of how it would once bugs are fixed.
Does not work!!! but a general idea of how it would once bugs are fixed .