Lagrange Interpolation: Difference between revisions
m
→{{header|Wren}}: Fixed a typo and added a program comment.
(Added Wren) |
m (→{{header|Wren}}: Fixed a typo and added a program comment.) |
||
Line 56:
var scalarMultiply = Fn.new { |poly, x| poly.map { |coef| coef * x }.toList }
// Divide a
var scalarDivide = Fn.new { |poly, x| scalarMultiply.call(poly, 1/x) }
// Returns the Lagrange interpolating polynomial which passes through a list of points.
var lagrange = Fn.new { |pts|
var c = pts.count
|