How do I plot a bunch of vectors in Maple and find the difference and cross product between them?

570 Views Asked by At

Title says it all. This is the assignment I'm trying to do. http://math.rutgers.edu/~shtelen/Teaching/Fall-2013/L1_instr.pdf Data I need to plot http://math.rutgers.edu/~shtelen/Teaching/Fall-2013/s251-TF_F13.html

Which package do I use Need maple to plot a lot of vectors and get difference and cross product

please help

3

There are 3 best solutions below

0
On

with(LinearAlgebra); is the package needed for the Cross Product to work.

CrossProduct(V1,V2); computes the cross product of the vectors $V1$ and $V2$. (Alternatively, V1 &x V2; also will give you the same result.)

Vectors can be defined in Maple using <>. For example, this is a vector: <1,2,3>;

The difference can be calculated normally, such as:

vec1:=<1,2,3>; vec2:=<2,3,4>; vec1-vec2;

4
On

Look at this one:

[> with(plots):
   arrow([seq(<(sin(i), cos(i), 1)>, i = 1 .. 50)], axes = boxed);

enter image description here

0
On

You can use the HTTP package of recent Maple to grab that cited data programmatically. The following code worked for me on Windows 7 Pro using each of 64bit Maple 15.01, 16.02, and 17.02.

Note that there are only 259 data sets; it jumps from 142 to 144.

restart:

with(StringTools):
with(XMLTools):

(N,str,b):=HTTP:-Get("http://math.rutgers.edu/~shtelen/Teaching/Fall-2013/Lab1_DataPage.htm"):

(n1,n2) := Search("<tr>",str),Search("</table>",str):
newstr:=Drop(Take(str,n2-1),n1-1):
xt:=FromString(cat("<html>",newstr,"</html>")):
S:=indets(xt,specfunc(anything,_XML_tr)):

# Now create Vdata a list lists, with an inner list containing a p,q,r triple
Vdata:=sort([seq([parse(op([1,2],s)),
                  eval([[p],[q],[r]],[parse(op([2,1],s))])[]],
                 s in S)]):

Vdata[1];

     [1, [15, 18, 14], [11, 23, 20], [13, 18, 13]]

Vdata[1][2],Vdata[1][3],Vdata[1][4];

        [15, 18, 14], [11, 23, 20], [13, 18, 13]


Vdata[5];

       [5, [11, 11, 13], [17, 8, 15], [15, 8, 8]]

# How many of them are there?
nops(Vdata);

                          259

# We can also index into Vdata from the other end.
Vdata[-1];

    [260, [18, 19, 13], [21, 24, 12], [20, 22, 17]]