[Maxima] vector3d

Alexey Beshenov al at beshenov.ru
Thu Mar 20 04:57:15 CDT 2008

On Thursday 20 March 2008 07:49, Robert Dodier wrote:

>> In my opinion, vect.mac approach is better. Anyway, this behavior could
>> be controlled by some flag.
> I think the multitude of flags makes it difficult for the user to
> understand what is going on, since the same code can have a
> different effect depending on flags. So I am not in favor of
> introducing another flag.

vector package can leave noun forms by default and compute operators in given 
coordinates by some function or if some flag is "true" (it should be "false" 
by default).

> Another way to avoid the whole listarith problem is to represent
> vectors as objects distinct from lists, e.g. vector(1, 2, 3)
> instead of [1, 2, 3]. Actually I am in favor of that; conflating
> different kinds of objects for convenience leads to unexpected
> results (e.g. listarith problems with vectors).

Lists are OK. listarith does unexpected things only with atoms which are
"not nonscalarp(x)". So we should force user to "declare(x,nonscalar)" for 
every atom x which is intended to be a vector:

(%i1) x . [1,2,3];
(%o1)                            x . [1, 2, 3]
(%i2) x * [1,2,3];
(%o2)                            [x, 2 x, 3 x]
(%i3) x + [1,2,3];
(%o3)                        [x + 1, x + 2, x + 3]
(%i4) declare(x,nonscalar);
(%o4)                                done
(%i5) x + [1,2,3];
(%o5)                            x + [1, 2, 3]

Alexey Beshenov <al at beshenov.ru>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://www.math.utexas.edu/pipermail/maxima/attachments/20080320/71ff5ce3/attachment.pgp 

More information about the Maxima mailing list