LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

converting complex numbers to vectors

I was wondering if  I could convert two complex numbers to vectors in order to get their cross and dot products. Any help would be appriciated! Thanks!

0 Kudos
Message 1 of 7
(3,887 Views)

There's a VI called Complex to ReIm, which gives you an x and y value.

There're VIs called Real Dot Product and Complex Dot Product, which each take in two vectors. I don't know the difference between the two VIs though because the documentation is identical.

Lastly, there's a VI called Cross Product, which takes two vector inputs.

 

If you don't have all of these VIs in your install, you might not have a high enough installed package. A few of these might require the LabVIEW Full Development System are may not be included in the Base Dev package.

Cheers


--------,       Unofficial Forum Rules and Guidelines                                           ,--------

          '---   >The shortest distance between two nodes is a straight wire>   ---'


Message 2 of 7
(3,868 Views)

Be careful.  Dot (or "inner") products are easily defined on complex numbers, but there may be an ambiguity on taking complex conjugates.  The Cross product of two 3-D vectors is well-defined and results in a vector perpendicular to the plane formed by the other two vectors -- if you are dealing with interpreting complex numbers as vectors in the X-Y Plane, then the Cross Product should be parallel to the Z axis ...  Not sure how you represent this.

 

Bob Schor

Message 3 of 7
(3,848 Views)

Complex numbers are vectors that can be interpreted as a direction and lenght in the complex plane.

 

LabVIEW does not have vectors in the sense you want. You probably mean 1D arrays.

 

To convert a complex datatype to a 1D DBL array with two elements (RE, IM), just typecast it to a DBL array as follows.

 

 

 

Also note that unlike e.g. matlab, LabVIEW makes no distinction between column vectors and row vectors in the linear algebra tools when using 1D arrays.

Sometimes you need to be more specific and use 2D arrays with a single column or single row instead.

Message 4 of 7
(3,834 Views)

hi, thanks for your reply, actually I am pretty new to the programme (ive started working with it like 2 days ago) my assignments ask to design a system which we can put the length of vector and its angle in and get the dot product and cross product out. I have no idea how to do it. I just know we have to have the following intput:

 

 

 

 

 

 

input

0 Kudos
Message 5 of 7
(3,818 Views)
http://www.ni.com/getting-started/labview-basics/ we won't do your homework for you, but once you get started, we can help answer specific questions.

Cheers


--------,       Unofficial Forum Rules and Guidelines                                           ,--------

          '---   >The shortest distance between two nodes is a straight wire>   ---'


0 Kudos
Message 6 of 7
(3,777 Views)

There are two independent issues here.  One is that you need to learn some LabVIEW, either on your own using the Tutorials we've mentioned to you (you can also do a Web search for LabVIEW tutorials, I'm sure) or through a class (pay attention and do all the homework, plus dream up routines on your own).  The second is learning the appropriate math (algebra, vectors, etc.) so you can translate "Radius and angle" into quantities that you can plug into formulae to come up with dot and cross products.

 

Note that the Math problem, which needs to be solved first, has nothing to do with LabVIEW.  However, once you have formulas relating Radius/Angle to dot and cross products, it should be easy to write the code in LabVIEW to do the computations.

 

Bob Schor

0 Kudos
Message 7 of 7
(3,745 Views)