Subject: Is there a package for physics vector notation?
From: Jaime Villate
Date: Sat, 10 Mar 2012 09:36:57 +0000
On 03/10/2012 04:31 AM, Richard Hennessy wrote:
> 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.
>
Hi Richard,
I have to work with vectors in Maxima very often and the best solution
I've found is to represent them as lists.
Check this out to see whether you like it:
(%i1) display2d: false$
(%i2) fpprintprec: 12$
(%i3) [i,j,k]: [[1,0,0],[0,1,0],[0,0,1]]$
(%i4) ?(a,b) := determinant(matrix([i,j,k],a,b))$
(%i5) infix(?)$
(%i6) v1: .7*i-3.4*j-.6*k;
(%o6) [0.7,-3.4,-0.6]
(%i7) v2: 1.4*i+6.9*j-9.78*k;
(%o7) [1.4,6.9,-9.78]
(%i8) v1.v2;
(%o8) -16.612
(%i9) v1?v2;
(%o9) [37.392,6.006,9.59]
If you do not want to use the Unicode character ? that I used for the
cross product, or if the Lisp
flavor you are using will not allow it, you can also define the cross
product as cross(a,b)
Regards,
Jaime