# Question:Displaying a cross product as an arrow

October 09 2013

0

I'm trying to display a cross product in a 3d plot, as an arrow.  I'm using LinearAlgebra[CrossProduct] and the arrow command from plots.  The arrow command takes vectors in angle brackets, but it won't take the output of CrossProduct.

I'm also confused because there seem to be two different arrow commands, one in plots and one in plottools.  If you have read in both of these libraries which one will be used?  I can't seem to get either of them to take the output of a CrossProduct.

I see there is also a cross product in VectorCalculus wish has i, j, k style output.  I haven't tried that one yet.

I am writing a procedure that will animate a particle traveling along a space curve, and show the velocity, acceleration, T , N and B vectors.  I've got everything to work except the B, which is T x N.

TN := proc (X, Y, Z, k) Xprime := diff(X, t); Yprime := diff(Y, t); Zprime := diff(Z, t); point(P, Xprime, Yprime, Zprime); Xdprime := diff(Xprime, t); Ydprime := diff(Yprime, t); Zdprime := diff(Zprime, t); point(o, 0, 0, 0); L := distance(P, o); Tx := Xprime/L; Ty := Yprime/L; Tz := Zprime/L; point(o, 0, 0, 0); Txprime := diff(Tx, t); Typrime := diff(Ty, t); Tzprime := diff(Tz, t); point(P, Txprime, Typrime, Tzprime); L2 := distance(P, o); Nx := Txprime/L2; Ny := Typrime/L2; Nz := Tzprime/L2; B := spacecurve([X, Y, Z], t = 0 .. k); A1 := animate(pointplot3d, [[X, Y, Z], color = black, symbol = solidsphere, symbolsize = 6], t = 0 .. k, frames = 100, background = B); A2 := animate(arrow, [`<,>`(X, Y, Z), `<,>`(Tx, Ty, Tz), width = [.1, relative], head_length = [.3, relative], color = blue], t = 0 .. k, frames = 100); A3 := animate(arrow, [`<,>`(X, Y, Z), `<,>`(Nx, Ny, Nz), width = [.1, relative], head_length = [.3, relative], color = red], t = 0 .. k, frames = 100); A4 := animate(arrow, [`<,>`(X, Y, Z), `<,>`(Xdprime, Ydprime, Zdprime), width = [0.3e-1, relative], head_length = [.3, relative], color = green], t = 0 .. k, frames = 100); A5 := animate(arrow, [`<,>`(X, Y, Z), `<,>`(Xprime, Yprime, Zprime), width = [0.3e-1, relative], head_length = [.3, relative], color = "MediumOrchid"], t = 0 .. k, frames = 100); display(A1, A2, A5, A4, A3) end proc:

TN(2*sin(t), 4*cos(t), 3*cos(t)^2, 2*Pi)

I am using Maple 15.  I learned to use Maple in the mid-ninties--I know I should learn all the new stuff and haven't done so yet.

By the way, it is a bit irritating not to be able to put "arrow"  or "cross product" as  tags because of my reputation isn't good enough, or something.  But it won't let me leave the tag box blank, either, so I just put in "vector"

﻿