Well, that was easy! So are these SAGE objects that you have to construct? Its not clear where this code comes from. Is it a python object, is it from maxima, gap, what?

Still, these constructs do not preserve the matrix paradigm from MATLAB. For example, in MATLAB you can pass a matrix as an input parameter and process all the data in the matrix. I that like a List object in python? I thought I read somewhere in the SAGE dox that this was possible. I don't know why I'm thinking its a scipy thing. What do you use scipy and numpy for? BTW, does SAGE use VPython?

How about another sample:
OCTAVE INPUT FILE:
#!/usr/bin/octave -q
diary vector2.txt

%vector2.m      MrG     2010.0324
%purpose:   playing with the cross product

%initialize 2 vectors in R^3
a=[1 0 5]
b=[-2 1 0]

%vector cross product
c=cross(a,b)
area=norm(c)
theta1=asin(area/norm(a)/norm(b))
theta2=theta1*180/pi

%scalar dot product
d=dot(a,b)
theta3=acos(d/norm(a)/norm(b))
theta4=theta3*180/pi

%triple scalar product
e=[1 1 1]
vol=abs(dot(e,c))

%vector dilation
f=2*a
g=-3*b

OCTAVE OUTPUT FILE:
a =

  1   0   5

b =

 -2   1   0

c =

  -5  -10    1

area =  11.225
theta1 =  1.3945
theta2 =  79.897
d = -2
theta3 =  1.7471
theta4 =  100.10
e =

  1   1   1

vol =  14
f =

   2    0   10

g =

  6  -3  -0

TIA,
A. Jorge Garcia
http://calcpage.tripod.com

Teacher & Professor
Applied Mathematics, Physics & Computer Science
Baldwin Senior High School & Nassau Community College


--
You received this message because you are subscribed to the Google Groups 
"sage-edu" group.
To post to this group, send email to sage-...@googlegroups.com.
To unsubscribe from this group, send email to 
sage-edu+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sage-edu?hl=en.

Reply via email to