# bilinear interpolation in a quadrilateral

This topic is 4684 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?

##### Share on other sites
You have received the answer on flipcode[grin]

##### Share on other sites

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

## Create an account or sign in to comment

You need to be a member in order to leave a comment

## Create an account

Sign up for a new account in our community. It's easy!

Register a new account

• ### Forum Statistics

• Total Topics
628645
• Total Posts
2984015

• 9
• 9
• 10
• 21
• 20