>
Warning, the name changecoords has been redefined
Warning, the name changecoords has been redefined
Maple Stuff with Vectors
Here are some Maple examples with vectors. They illustrate the syntax
of some useful commands for vector operations, etc. You can make
the commands ``happen'' by hitting RETURN at the end of any input
line. Input lines are in red on a color monitor, and they start
with a > symbol.
To work with vectors, the first step is to load a package of vector things,
called linalg. Here's how to load it:
> with( linalg );
The result is to load a whole slew of vector- and matrix-oriented commands (most
of which we'll have no use for). Note that among the commands loaded
are crossprod and dotprod. They do what you'd think.
Let's define some vectors for Maple to work with. We do so using the vector
command, as follows:
> v := vector( [1,2,3] );
> w := vector( [4,5,6] );
Now let's do some things with these vectors:
> dotprod( v,w );
> dotprod( w,v );
> crossprod( v,w );
> crossprod( w,v );
Does that look right?
> n := crossprod( v,w );
> crossprod( n, n );
> crossprod( v+w, v-w );
> crossprod( 2*v,3*v);
> 2*v+3*w;
That's all very nice, but what's the numerical answer?
Here's how to get it:
> evalm(");
The evalm command ``evaluates'' a vector or matrix to
more or less numerical form.
Here's another useful linear algebra style command.
> m := matrix( [[1,2,3],[2,3,4],[3,4,5]] );
> rref(m);