Subject: Is there a package for physics vector notation?
From: Richard Hennessy
Date: Fri, 09 Mar 2012 23:31:00 -0500
Hi,
I want to use Maxima to use i, j, k notation for vectors and have a dot
product and cross product operation for two vectors inputted this way. I
have quickly tried the dirty method below but if there is something already
written then maybe I can avoid reinventing the wheel.
(%i9) reset();
(%o1)
(%i2) kill(rules);
(%o2)
(%i3) kill(all);
(%o0)
(%i1) display2d:false;
(%o1) false
(%i2) tellsimp(i*i,1);
(%o2) [?\^rule7,?simpexpt]
(%i3) tellsimp(j*j,1);
(%o3) [?\^rule8,?\^rule7,?simpexpt]
(%i4) tellsimp(k*k,1);
(%o4) [?\^rule9,?\^rule8,?\^rule7,?simpexpt]
(%i5) v1=.7*i-3.4*j-.6*k;
(%o5) v1 = -0.6*k-3.4*j+0.7*i
(%i6) v2=1.4*i+6.9*j-9.78*k;
(%o6) v2 = -9.779999999999999*k+6.9*j+1.4*i
(%i7) v1*v2,%o5,%o6;
(%o7) (-9.779999999999999*k+6.9*j+1.4*i)*(-0.6*k-3.4*j+0.7*i)
(%i8) expand(%);
(%o8) 29.112*j*k-7.685999999999999*i*k+0.07*i*j-16.612
I can pick off the answer as the last item in the last sum (-16.612). Is
there another way? As far as the cross product is concerned, I know there
already is a way using matrices, but I want to avoid that too.
Rich