# bilinear interpolation in a quadrilateral

This topic is 5049 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

I have a quadrilateral defined by four vertices, a, b, c and d. Each vertex has a colour value associated with it. I then have a point P which I know lies inside the quadrilateral. How do I get an interpolated colour value for P? Ideally I would like to get a weight for each vertex as I may have more than one value to interpolate. I remember deriving this at university. The method started with drawing a line, ef, that bisects ab and cd and passes through P, like so:
d -------- f ---- c
|             |        |
|             |        |
g -------- P ---- h
|             |        |
a -------- e ---- b

You then use the equality
(e-a)/(b-a) = (f-d)/(c-d)
as your starting point and you end up with an equation that you solve using the quadratic formula. So I know essentially what I have to do: I'm just getting fuzzy in the middle! Can anyone help me?

1. 1
2. 2
3. 3
Rutin
14
4. 4
5. 5

• 9
• 9
• 11
• 11
• 23
• ### Forum Statistics

• Total Topics
633674
• Total Posts
3013276
×