09-18-2015 01:04 PM
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!
09-18-2015 01:43 PM
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> ---'
09-18-2015 04:01 PM
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
09-18-2015 05:52 PM - edited 09-18-2015 06:11 PM
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.
09-18-2015 06:34 PM - edited 09-18-2015 06:43 PM
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:
09-19-2015 10:23 AM
Cheers
--------, Unofficial Forum Rules and Guidelines ,--------
'--- >The shortest distance between two nodes is a straight wire> ---'
09-19-2015 05:42 PM
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