Semester Project - Piecewise Linear Interpolation

Thomas J. Kennedy

Contents:

1 Prerequisites

  1. If you have not already done so… read the Semester Project Description

  2. Revisit the Least Squares Approximation Introduction

2 Deliverables

Submit a single archive that contains a/an:

  1. updated README.md
  2. input library in your selected language
  3. Piecewise Linear Interpolation module
  4. main driver

3 First Steps

If you received any feedback on your previous Semester Project Milestone submission. Make the required changes before continuing.

You will need to take the interpolation formulas from Least Squares Approximation Introduction and adapt them to our current notation.

Start with

$$ y = mx + b $$

and swap the linear and constant terms

$$ y = b + mx $$

We know that slope for two points is written as

$$ m = \frac{y_1 - y_0}{x_1 - x_0} $$

For piecewise linear interpolation we need to replace

The index change leads to…

$$ m = \frac{y_{k+1} - y_{k}}{x_{k+1} - x_{k}} $$

The y-intercept (after similiar changes) becomes…

$$ b = y_{k} - m x_{k} $$

or

$$ b = y_{k+1} - m x_{k+1} $$

These updated formulae will allow us to compute a line for any pair of adjacent points.