Barycentric Interpolation
Transcript of Barycentric Interpolation
Barycentric InterpolationHow do you interpolate values defined atvertices across the entire triangle?
Barycentric InterpolationHow do you interpolate values defined atvertices across the entire triangle?
Solve a simpler problem first:
x1
x2
Barycentric InterpolationHow do you interpolate values defined atvertices across the entire triangle?
Solve a simpler problem first:
x1
x2
t
Want to define a value for every t ε [0,1]:
0
0
1
1t
Barycentric Interpolation
How do we come up with this equation?Look at the picture!
tt
Barycentric Interpolation
The further t is from the red point, the more blue we want.
tt
Barycentric Interpolation
The further t is from the red point, the more blue we want.
The further t is from the blue point, the more red we want.
tt
t
Barycentric Interpolation
The further t is from the red point, the more blue we want.
The further t is from the blue point, the more red we want.
Percent blue = (length of blue segment)/(total length)
t
Barycentric Interpolation
The further t is from the red point, the more blue we want.
The further t is from the blue point, the more red we want.
t
Percent blue = (length of blue segment)/(total length)Percent red = (length of red segment)/(total length)
t
Barycentric Interpolation
The further t is from the red point, the more blue we want.
The further t is from the blue point, the more red we want.
t
Percent blue = (length of blue segment)/(total length)Percent red = (length of red segment)/(total length)
Value at t = (% blue)(value at blue) + (% red)(value at red)
Barycentric Interpolation
The further t is from the red point, the more blue we want.
The further t is from the blue point, the more red we want.
t
Percent blue = tPercent red = 1-tValue at t = tx1 + (1-t)x2
x1
x2
t0
1
Barycentric Interpolation
Now what about triangles?
Barycentric Interpolation
Now what about triangles?
Just consider the geometry:
What’s the interpolatedvalue at the point p?
p
x1
x2
x3
Barycentric Interpolation
p
x1
x2
x3
Last time (in 1D) we usedratios of lengths.
t
Barycentric Interpolation
Now what about triangles?
Just consider the geometry:
p
What about ratios of areas (2D)?
Barycentric Interpolation
Now what about triangles?
Just consider the geometry:
p
If we color the areas carefully,the red area (for example)covers more of the triangle asp approaches the red point.
p
Barycentric Interpolation
Just like before:percent red = area of red triangle
total area
percent green = area of green triangletotal area
percent blue = area of blue triangletotal area
p
Barycentric Interpolation
Just like before:
Value at p:
(% red)(value at red) +(% green)(value at green) +(% blue)(value at blue)
percent red = area of red triangletotal area
percent green = area of green triangletotal area
percent blue = area of blue triangletotal area
p
x3
A3
A1
A1
A2
x1
x2
Barycentric Interpolation
“barycentric interpolation”a.k.a. “convex combination”a.k.a. “affine linear extension”
Just like before:Why? Look at the picture!
“barycentriccoordinates”
= λ1
Σi λi=1
= λ2
= λ3
Value at p:
(A1x1 + A2x2 + A3x3 )/A
percent red = AA2AA3A
percent green =
percent blue =
Now convert this to a bunch of ugly symbols if you want... just don’t think about it that way!