# color interpolation using interpolating functions on a quadrilateral

How can I use the interpolating functions I constructed for the four nodes of a quadrilateral to use as parameters to smoothly paint the edges of the quadrilateral when 4 different color values are given on the four nodes already. how do I use these as parameters to do it? do I have to do it piecewise or do I have to use the polynomial: the sum of the product of the interpolating function with their respective data point?

localCoordinates={{-(5/4), -(3/2)}, {3/4, -(3/2)}, {7/4, 7/2}, {-(5/4), -(1/2)}};

deltaNa=((7 + 8 x - 6 y) (-21 + 20 x - 4 y))/(4 (169 + 80 x + 6 y));

deltaNb=-((5 (5 + 4 x) (7 + 8 x - 6 y))/(4 (169 + 80 x + 6 y)));

deltaNc=-((11 (5 + 4 x) (3 + 2 y))/(4 (169 + 80 x + 6 y)));

deltaNd=-((3 (3 + 2 y) (21 - 20 x + 4 y))/(4 (169 + 80 x + 6 y)));


the A, B, C, D is in the order of the list in localCoordinates; can Manipulate also be incorporated for changing the values.

I really do not know ho to do it so I want to find help.

By pulling back to the unit square and by creating a texture:

localCoordinates = {{-(5/4), -(3/2)}, {3/4, -(3/2)}, {7/4, 7/2}, {-(5/4), -(1/2)}};
deltaNa[x_, y_] = ((7 + 8 x - 6 y) (-21 + 20 x - 4 y))/(4 (169 + 80 x + 6 y));
deltaNb[x_, y_] = -((5 (5 + 4 x) (7 + 8 x - 6 y))/(4 (169 + 80 x + 6 y)));
deltaNc[x_, y_] = -((11 (5 + 4 x) (3 + 2 y))/(4 (169 + 80 x + 6 y)));
deltaNd[x_, y_] = -((3 (3 + 2 y) (21 - 20 x + 4 y))/(4 (169 + 80 x + 6 y)));

fa[x_, y_] = deltaNa @@ ({(1 - x) (1 - y), x (1 - y), x y, (1 - x) y}.localCoordinates);
fb[x_, y_] = deltaNb @@ ({(1 - x) (1 - y), x (1 - y), x y, (1 - x) y}.localCoordinates);
fc[x_, y_] = deltaNc @@ ({(1 - x) (1 - y), x (1 - y), x y, (1 - x) y}.localCoordinates);
fd[x_, y_] = deltaNd @@ ({(1 - x) (1 - y), x (1 - y), x y, (1 - x) y}.localCoordinates);
cols = Join[IdentityMatrix, {{0, 0, 0}}];
f[x_, y_] = -{fa[x, y], fb[x, y], fc[x, y], fd[x, y]}.cols;
n = 128;
a = Outer[f, Subdivide[0., 1., n], Subdivide[0., 1., n]];
tex = Image[a];

Graphics[{
Texture[tex],
GraphicsComplex[
localCoordinates,
Polygon[{{1, 2, 3, 4}}],
VertexTextureCoordinates -> {{0, 0}, {1, 0}, {1, 1}, {0, 1}}
]
} • how can the color only be shown on the edges, not the interior, and make the edges stand out? Nov 10, 2018 at 16:15