commands → interpolate

interpolate(A,B)
interpolate(A,B,P)

The interpolate command constructs the coefficients of a polynomial passing through the points [Ai,Bi]. The points [Ai] must be distinct. If an optional third argument P is provided, the computation is done modulo P.

Examples

A = [1,2];
B = [3,7];
interpolate(A,B);
	[-1, 4]