Can't use the result of solve() to define a function



Hi list,

I want to do some coordinate transformation between (x,y) and (?,?)
For a simple try, I want to map a triangle (x1,y1) - (x2,y2) - (x3,y3) to
{(?,?) | ?>=0, ? >=0, ?+? <= 1}
This appears in beginner-level finite element method problems.

What I have tried is as follows.

    p1:[x1,y1] $ p2:[x2,y2] $ p3:[x3,y3] $

    p(?,?):=p1+?*(p2-p1)+?*(p3-p1);   /* This maps from (?,?) to (x,y).  I
want to make an inverse of this */

    eqnx : x = p(?,?)[1];

    eqny : y = p(?,?)[2];

    results:solve([eqnx, eqny], [?,?]);

    rhs(results[1][1]);                  /* This gives me what I want as the
definition of N?(x,y) */

    N?(x,y) := rhs(results[1][1]);   /* But this does not define a function
that I want */

I am using maxima 5.20.1 on Ubuntu Linux.

In the above specific case the mapping from (?,?) to (x,y) is linear,
so using matrices is one solution, but I also want to try out mappings that
are
non-linear so I want to use solve to get the inverse function.

-- 
Hideo at Yokohama