Given a triangle I'm searching for the canvas transformation to transform it into an other Triangle with the corner coordinates (A,B,C)
Input triangle: Red Triangle: A'=(0,0) B'=(80,80) C'=(0,80)
Output triangle: Triangle with the coordinates A=(10,30), B=(150,110), C=(50,140)
I'm looking for the transformation that transforms the Input triangle into the output triangle where the points A, B and C should be parameters of the transformation.
The code that transforms the red into the green triangle can be found at http://jsfiddle.net/Tarion/mc9mT/ - yet it is obviously wrong because it does not fit the points A,B,C.
What I need is the code or at least the strategy to transform the red triangle it to the triangle that is defined by the given points A,B,C
The green triangle is not the solution but just an (almost) arbitrary transformation of the red one.