Menu

function to return an equation from two point

p3aul1
2012-04-07
2012-09-10
  • p3aul1

    p3aul1 - 2012-04-07

    Is there a function that will return an equation when I specify two points (2,
    3) (-6, 1)?

     
  • Ago77

    Ago77 - 2012-04-08

    There are a lot of curves, but this gives a line, or more generally a
    polynomial of degree n-1, for n points:

    load(interpol)$

    p: [, ]$

    define(f(x), lagrange(p));

    wxdraw2d(point_type=filled_circle, point_size=1, points(p),

    explicit(f(x), x, -10, 10))$