pub fn lagrange_basis(points: Seq<(FpVesta, FpVesta)>, x: FpVesta) -> Polyx
Expand description

Finds the Lagrange basis for a set of points and a single evaluation point x This will produce a polynomial that evaluates to 1 at xand to 0 at all other x-values in the set points No other guarentees are given about the resulting polynomial

Arguments

  • pointsis a sequence of points (Fp,Fp) whose x-values the polynomial wil evaluate to 0 at
  • xis the x-value where the polynomial will evaluate to 1. If xis also in points the polynomial will still evaluate to 1 at `x``

Assertions

  • No two points may have the same x-value