Message Boards Message Boards

0
|
4941 Views
|
1 Reply
|
0 Total Likes
View groups...
Share
Share this post:

How can I calculate the cross product of a point with a list of vectors?

Posted 10 years ago

I am trying to calculate field using vector summation. I have a loop (in 2D) then hopefully a helix in 3D. For each point, I need to calculate the vector r^, distances to the discretized loop. This i hope will give a list of r^'s. I then need the cross product ( J x r^)

I thought I could map the function cross product for the point a=1,1,0 to the vectors, but having some difficulty.

This probably will not make sense. Thank you in advance

en = 2;
comp = 0.2;
turns = 1;
(*pitch = comp*2*\[Pi]*)
uStep = 0.05;
(*zscale = 1/( comp*uStep);*)
height = Round[turns*pitch] + 1;
x[u_] := Round[en Sin[u]] + en + 1;
y[u_] := Round[en Cos[u]] + en + 1;


biArray = 
 ConstantArray[
  0, {2 en + 1, 2 en + 1, 
   3}]; (*x and y this is for defining the helix*) 
biVArray = ConstantArray[{0, 0, 0}, {2 en + 1, 2 en + 1}]; 
(*vector 0,0,0 in x,y, and z this is for defining the vectors of the \
helix*)
biRArray = ConstantArray[{0, 0, 0}, {2 en + 1, 2 en + 1}];

Do[biArray[[x[u], y[u]]] = 1, {u, 0, turns 2 Pi, 
  0.1}] (*For points in array which contain the helix are given \
value=1*)
Do[biVArray[[x[u], y[u]]] = {x[u + 1] - x[u - 1], 
   y[u + 1] - y[u - 1],(*z defined here as 0*)0}, {u, uStep, 
  turns 2 Pi - uStep, 
  uStep}](*For points in array which contain the helix direction of \
the vector*)

Print[biVArray]

a={1,1,0}
Map[Cross[a, {biVArray}]]
Attachments:
POSTED BY: Francis Ridgeon

For future reference, see http://community.wolfram.com/groups/-/m/t/270507 , under Code Formatting, for incantations to format code nicely.

POSTED BY: Bruce Miller
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract