++j){
			Ai.push(0);
			for(var k = 0; k < N; ++k){
				Ai[j] += Math.pow(points[k][0], i + j);
			}
		}
		A.push(Ai);
		B.push(0);
		for(var k = 0; k < N; ++k){
			B[i] += points[k][1] * Math.pow(points[k][0], i);
		}
	}
	var P = solved_linear(A, B,n);
	return function(x) {
		var Px = 0;
		for(var i = 0; i < n; ++i) {
			Px += P[i] * Math.pow(x, i);
		}
		return Px;
	};
}

function interpolation_of(points) {
	const N = points.length;
	var A = [];
	var B = [];

	for (var i = 0; i < N; ++i){
		var Ai = []
		