Hello,
I am just coding a new definiton of a vector and some basic vector
simplifications and functions.
At the moment I wonder what vector * vector and vector ^ -1should be.
Let be
v1: vector(x,y); and v2: vector(p,q);
l1: [x,y]; and l2: [p,q];
m1: matrix([a,b],[c,d]); and m2: matrix([x,y],[p,q]);
At the moment we have
l1*l2; --> [p*x,q*y]
m1*m2; --> matrix([a*x,b*y],[c*p,d*q])
which is the same as
map("*",l1,l2);
map("*",m1,m2);
According to this would follow
v1*v2; --> vector(p*x,q*y)
I'm not shure if this all is consistent. Consider
s*l1; --> [s*x,s*y]
%, s=l2; --> [[p*x,q*x],[p*y,q*y]]
Shouldn't this be the same as l1*l2 ?
The same with s*m1; followed by %, s=m2;
I would like to know the reasons for the definitons we have at the moment
concerning times operations on lists and matrices.
The second question is, what should v1^-1 be?
l1^-1; --> [1/x,1/y]
which is the same as
map(lambda([e],e^-1),l1);
So
v1^-1; --> vector(1/x,1/y) ?
Volker van Nek