MathGroup Archive 2006

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Change of Basis function


Clear[functionX];

functionX[x_?VectorQ, b_List]:=LinearSolve[Transpose[b],x];

functionX[x_, b_?VectorQ]:=Coefficient[x,#]&/@b;

functionX[{1,2,3},{{1,2,0},{0,1,0},{0,0,1}}]

{1,0,3}

functionX[f x1 - b x2 + x3 - x2,{x1,x2,x3}]

{f,-b-1,1}


Bob Hanlon

---- David Boily <dsboily at fastmail.ca> wrote: 
> I would like to know if there is a function capable of giving as output
> the representation of a vector in a given basis. For example:
> 
> FunctionX[{1,2,3}, {{1,2,0},{0,1,0},{0,0,1}}]
> 
> (where the first argument is the vector and the second the basis)
> 
> would yield
> 
> {1,0,3}
> 
> and
> 
> FunctionX[f x1 - b x2 + x3 - x2, {x1,x2,x3}]
> 
> would yield 
> 
> {f, -b-1, 1}
> 
> I'm more interested in the second case, obviously, because the first one
> can be achieved with a simple matrix multiplication.
> 
> David Boily
> Center for Intelligent Machines 
> Mcgill University
> 


  • Prev by Date: Re: Matrix Multiplication (with a twist)
  • Next by Date: Re: path along equi-contours
  • Previous by thread: Re: Change of Basis function
  • Next by thread: Re: Change of Basis function