Function makeLinear

  • Linear interpolation and extrapolation.

    Given two points, this function will find the line that lines on those two points. And it will return a function that will find all points on that line.

    Parameters

    • x1: number

      One valid input.

    • y1: number

      The expected output at x1.

    • x2: number

      Another valid input. Must differ from x2.

    • y2: number

      The expected output at x2.

    Returns LinearFunction

    A function of a line. Give an x as input and it will return the expected y. Inputs and outputs of makeLinear()