How to work with vectors in Igor?

Hi,

I have long lists of x, y, and z coordinates in three different waves and would like to use them to virtually span planes and finally calculate the angle between two of these planes using vectors.
Are there any commands in Igor to simplify calculations using vectors or do I have to do the calculations (like substractions, cross product etc.) for each coordinate individually and save the results in individual variables?

Thanks a lot for your help in advance!
In general, I recommend combining your 1D waves into triplet wave ( a 2D wave of 3 columns). You can accomplish this using the command:
concatenate {xwave,ywave,zwave},tripletWave


Once you have a triplet wave you can display it in Gizmo and use MatrixOP to apply various "vector" operations.

A.G.
WaveMetrics, Inc.
Thank you for this very helpful reply!

Displaying the vectors and performing fifferent operations is a good idea in general.
Unfortunately I did not mention that my list contains several hundreds or thousands of data points, so that displaying each of them is not an option in my case.

Are there any commands within Igor I can apply to use vectors in the plain equation and calculation of the normal vector of the plains?
The only output I need in the end is a list oftorsion angles between all pairs of "neighbouring" plains.
Is there a command do calculate the vector product?

x,y,z data is in a 2D wave with 3 columns, as you suggested in your post. I have calculated the directional vectors to span a plane and would like to get to the normal vector from the cross product / vector product of those two direction vectors.
researcher2 wrote:
Is there a command do calculate the vector product?


If you arrange your vector components into 3 elements of a wave e.g.,
Make/N=3 vectorA={1,1,0}
Make/N=3 vectorB={0,1,1}
Cross vectorA,vectorB
Print W_Cross


I hope this helps,

A.G.
Thanks a lot, this command will help me a lot!

Now I have to find out how to use it in a proper way or transform my data format so I can use it, since my coordinates are in a 2D wave of the format {{x}, {y}, {z}} at the moment.

What I have right now is:
concatenate {xcoord,ycoord,zcoord}, vectorwave
matrixOP r11 = row(vectorwave,i+1)-row(vectorwave,i) //direction vector 1 plane 1
matrixOP r12 = row(vectorwave,i+2)-row(vectorwave,i) //direction vector 2 plane 1
matrixOP r21 = row(vectorwave,i+2)-row(vectorwave,i+1) //direction vector 1 plane 2
matrixOP r22 = row(vectorwave,i+3)-row(vectorwave,i+1) //direction vector 2 plane 2


SO the next step would be to calculate the cross vector as you mentioned:
Cross r11, r12

but therefore, they don´t have the right dimension, or am I wrong?

In a last step I then have to use this cross vectors to calculate the torsion angle between the two planes, but this is rather easy:
cos(gamma) = (n1*n2)/(|n1|*|n2|)

EDIT: is there maybe a way to transfer my original x,y,z-data, which is stored in 3 the different waves xcoord, ycoord, zcoord into a wave/format, which looks like {x, y, y}?
Because then I would circumvent the problems with the different dimensions.

As a first preliminary solution a do this extra step:
make/O/N=3 r1
make/O/N=3 r2
r1 = r11[0][p]
r2 = r12[0][p]
Cross r1,r2

It works, but is quite circumstantial, I am a newcomer in programming as you can see :)
researcher2 wrote:

concatenate {xcoord,ycoord,zcoord}, vectorwave
matrixOP r11 = row(vectorwave,i+1)-row(vectorwave,i) //direction vector 1 plane 1
matrixOP r12 = row(vectorwave,i+2)-row(vectorwave,i) //direction vector 2 plane 1
matrixOP r21 = row(vectorwave,i+2)-row(vectorwave,i+1) //direction vector 1 plane 2
matrixOP r22 = row(vectorwave,i+3)-row(vectorwave,i+1) //direction vector 2 plane 2


SO the next step would be to calculate the cross vector as you mentioned:
Cross r11, r12

but therefore, they don´t have the right dimension, or am I wrong?


Your rows, e.g., r11... are going to have a dimension of (1,3). You need to transpose that:
matrixOP r11 = (row(vectorwave,i+1)-row(vectorwave,i))^t