You can write the points in the case as columns in the matrix, and then specify a vector that tells you which combination of points to take:
(X1 X2) (a) (X1a + X2b) (Y1 Y2) (b) = (Y1a + Y2b) (Z1 Z2) (Z1a + Z2b)
To generate a target point, you want to find a vector that solves this, taking into account the limitations that the elements of the vector are between 0 and 1, and that the elements of the vector are up to 1. You can solve this problem by looking at the problem - if there is a solution - through linear programming Which may include the use of http://en.wikipedia.org/wiki/Simplex_algorithm .
There are many tricks to get this in strict form. Adding another row to the matrix allows you to say a + b = 1. To force b <= 1, you could have b + q = 1 and q> = 0, although, as Ted Hopp points out below, in this case b <= 1, because a + b = 1, and both a and b → 0.
source share