In the vect1 package, there are a number of useful functions for
performing vector operations. Those functions are illustrated here.

First save the package file "vect1.mac" to a folder on your computer.
Use File --> Load Package... (or Ctrl+L) to find and load the package.

(%i1) load("C:/Documents and Settings/Compaq_Owner/My Documents/Maxima/vect1.mac")$

(1)
The norm() function computes the magnitude of a vector.

(%i2) u: [1,-2,3];
Result

(%i3) norm( u );
Result

(2)
The normalize() function normalizes a vector.

(%i4) v: [4,1,-3];
Result

(%i5) normalize( v );
Result

(%i6) float(%);
Result

(%i7) norm(%);
Result

(3)
The dot() function computes the dot product of two vectors.

(%i8) dot( [1,2], [4,-3] );
Result

(%i9) u: [1/2,-3,4/3]; v: [-1,2/5,-6];
Result

(%i11) dot( u, v );
Result

(4)
The cross() function computes the cross products of two 3D vectors.

(%i12) u: [1,-2,1]; v: [3,-2,2];
Result

(%i14) cross( u, v );
Result

(%i15) cross( v, u );
Result

(5)
The angle() function computes the angle between two vectors.

(%i16) angle( [2,3], [1,0] );
Result

(%i17) float(%);
Result

(%i18) u: [4,2,1]; v: [0,4,-5];
Result

(%i20) angle( u, v );
Result

(%i21) float(%*180/%pi);
Result

(6)
The allsimp() function attempts to simplify using a variety of techniques.

(%i22) cos(1)^2+sin(1)^2;
Result

(%i23) allsimp(%);
Result

(%i24) 1/sqrt(430);
Result

(%i25) allsimp(%);
Result

(7)
The nabla() function computes the gradient vector.

(%i26) nabla( 2*x^2+4*y^4, [x,y] );
Result

(%i27) nabla( x^3*y^2*z + sin(x*y*z), [x,y,z] );
Result


Created with wxMaxima.