Page 324 ·
Robotics with the Boe-Bot
)
x
x
(
)
y
y
(
m
)
x
x
(
m
)
y
y
(
)
b
mx
y
(
b
mx
y
1
2
1
2
1
2
1
2
1
1
2
2
−
−
=
−
=
−
−
−
−
−
−
−
−
−
−
−
−
−
−
+
=
−
+
=
Once you’ve solved for m, you can plug m back into either of the two y = mx + b
equations you started with to get b.
2
2
2
2
mx
y
b
b
mx
y
−
=
+
=
So, the two equations for solving for m and b turn out to be:
)
x
x
(
)
y
y
(
m
1
2
1
2
−
−
=
and
2
2
mx
y
b
−
=
Let’s plug our sample values from Table F-2 into the equations and see what the scale
factor (m) and offset constant (b) will be for the left photoresistor. First, calculate m:
37
.
1
116
159
m
)
36
152
(
)
56
215
(
m
)
x
x
(
)
y
y
(
m
1
2
1
2
=
=
−
−
=
−
−
=
Then, use m, y
2,
and x
2
to calculate b:
7
b
76
.
6
b
)
152
37
.
1
(
215
b
≈
=
×
−
=