Graphics Reference
In-Depth Information
expresses the masses as fractions of the total mass, i.e.
m
i
m
1
+
m
2
+
m
3
t
i
=
And we see that the centroid is located at (5, 5, 3).
m
i
t
i
x
i
y
i
z
i
t
i
x
i
t
i
y
i
t
i
z
i
1
2
12
8
6
2
4
3
1
1
3
2
3
8
2
3
3
1
1
1
6
1
3
4
2
6
6
1
1
x
=5
y
=5
z
=3
Having discovered barycentric coordinates in weight balancing, let's see
how they emerge in linear interpolation.
11.4 Linear Interpolation
Suppose that we wish to find a value mid-way between two scalars
A
and
B
.
We could proceed as follows:
V
=
A
+
1
A
)=
A
+
1
1
2
A
=
1
2
A
+
1
2
B
which seems rather obvious. Similarly, to find a value one-third between
A
and
B
, we could write
2
(
B
−
2
B
−
V
=
A
+
1
A
)=
A
+
1
1
3
A
=
2
3
A
+
1
3
B
Generalizing, to find some fraction
t
between
A
and
B
we can write
3
(
B
−
3
B
−
V
=
A
+
t
(
B
−
A
)=
A
+
tB
−
tA
=(1
−
t
)
A
+
tB
(11.10)
3
4
For example, to find a value
between 10 and 18 we have
V
=
1
3
4
10 +
3
−
×
4
×
18 = 2
.
5+13
.
5=16
Although this is a trivial formula, it is very useful when interpolating between
two numerical values. Let's explore (11.10) in greater detail.
To begin with, it is worth noting that the multipliers of
A
and
B
sum to 1:
(1
−
t
)+
t
=1