LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Calculating a dot product with two 3D Arrays ( X Y Z components)


@Bob_Schor wrote:

If I needed to do a lot of Vector Norms in my LabVIEW code, I'd create the above-VI, name it something sensible (like "Vector Norm"), make it an Inline routine so it takes almost no memory space and runs at maximum speed, and be done with it.

 


I would just use this. 😄

Message 11 of 16
(490 Views)

This thread is really not going anywhere.

 

So we have your data. What exactly are you trying to get out of it? Why are you showing use convoluted code? Does it do what you want?

 

A "literal" rewrite would be as follows, but I doubt that's really what you need here.

 

altenbach_0-1658961537448.png

 

 

 

How do you expect the end result to look like? (You said you can do it easily in MATLAB, so just show us the MATLAB code and the apparently correct result.)

0 Kudos
Message 12 of 16
(484 Views)

@altenbach wrote:

This thread is really not going anywhere.

 

So we have your data. What exactly are you trying to get out of it? Why are you showing use convoluted code? Does it do what you want?

 

A "literal" rewrite would be as follows, but I doubt that's really what you need here.

 

altenbach_0-1658961537448.png

 

 

 

How do you expect the end result to look like? (You said you can do it easily in MATLAB, so just show us the MATLAB code and the apparently correct result.)


Another student trying to define a plane from 3 points.  Cross product of two xyz points is still the normal vector


"Should be" isn't "Is" -Jay
0 Kudos
Message 13 of 16
(474 Views)

The end result is the joint angle of the elbow. I attached the resultant image from MATLAB. I also posted a snippet of MATLAB code. I think I found a solution to my dot product problem though through previous replies. 

mbel_0-1658962951956.png

mbel_1-1658963090659.png

 

 

0 Kudos
Message 14 of 16
(471 Views)

@mbel wrote:

The end result is the joint angle of the elbow. I attached the resultant image from MATLAB. I also posted a snippet of MATLAB code. I think I found a solution to my dot product problem though through previous replies. 

mbel_0-1658962951956.png

 

 

 


So you have a time series of points in space and want a time series of angles. All you need is calculate the angle for each time point based on the selected coordinates. This seems trivial to do, so please share your solution so we can potentially offer improvements.

 

0 Kudos
Message 15 of 16
(449 Views)

As @altenbach points out, you have a (time-series of) 3 points in space representing two intersecting straight lines (call the points A, B, and C, with B being the "point in the middle").  If we say "AB" is both the vector from A to B and "BC" the vector from B to C, do you know the (fairly simple) formula for calculating AB · BC (the dot product of AB and BC)?  [All you need are the coordinates ...]  And, if you know the dot product, with a little more math, you can get the angle between AB and BC, which is your ultimate aim.

 

Bob Schor

0 Kudos
Message 16 of 16
(436 Views)