You are on page 1of 5

Interpolation Work Sheet

Enter the known data pairs here:


x
y
Data 1
1
4
Data 2
3
5

M
B

Linear Interpolation

This routine calculates a line that passes through two data pairs x1,y1 and x
values that define the line: M, the slope of the line, and B, the offset of the lin
been calculated, any other x or y data points can then be found on the line.

Calculated M and B:
0.5
3.5

Test x

Result y
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30

Here are how M and B are calculated:


OK
M = (y2-y1)/(x2-x1), and B = y2 - (x2 * M) or y1 - (x1 * M)
Test y

4
4.5
5
5.5
6
6.5
7
7.5
8
8.5
9
9.5
10
10.5
11
11.5
12
12.5
13
13.5
14
14.5
15
15.5
16
16.5
17
17.5
18
18.5

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30

Result x
-5
-3
-1
1
3
5
7
9
11
13
15
17
19
21
23
25
27
29
31
33
35
37
39
41
43
45
47
49
51
53

Then new y points can be found with y = Mx + b,


and new x points can be found with x = (y-B)/M.
Instructions:

1. Enter the known data pairs x1,y1 and x2, y2 at the top left.
2. Enter test x values to see result y values, or enter test y values to see res

Page 1

Interpolation Work Sheet

ugh two data pairs x1,y1 and x2,y2. It computes two


line, and B, the offset of the line. Once M and B have
can then be found on the line.

2 at the top left.


r enter test y values to see result x values.

Page 2

Chart

xmin
xmax

Chart Settings
x
Result y
-10
-1.5
10
8.5

y = 0.5x + 3.5
10
8
6
4
2

Chart Title y = 0.5x + 3.5


Axis Title
-10

0
-8

-6

-4

-2

0
-2
-4
-6
-8
-10
Axis Title

Page 3

Chart

10

Page 4

Copyright

Copyright 1996, P. Lutus -- lutusp@arachnoid.com. These works


are in the CareWare program. Please read the description at
http://www.arachnoid.com/careware.

Page 5

You might also like