LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Rotate a cartesian array plot

Solved!
Go to solution

Hello,

Suppose I have a 2d array(360x2) which is taken from text file and all the elements are converted to cartesian and placed in xy array and plotted as well. Now i want to rotate xy array plot with the help of slide.I am attaching 2 text files which are corresponding to theta-r array and xy array.Kindly help me with ths issue.

0 Kudos
Message 1 of 14
(4,818 Views)

Hi Venka,

 

when you already have r/theta values it becomes quite easy:

 

check.png

 

Btw:

What's the purpose of all those local variables in your BD image? Why don't you use wires and shift registers instead?

What's the purpose of that sequence structure? If you would use wires you could get rid of it…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 14
(4,750 Views)

GerdW wrote:

when you already have r/theta values it becomes quite easy:


You can simplify it even more (bottom of image) Same result!!

 

 

 

(If you also want scaling in addition to the rotation, just replace the "1" with a control. 😉

 

Note that you can wire the complex array directly to the xy graph. No need for clusters!

Message 3 of 14
(4,727 Views)

Here's some very simple code. See if you can modify it for your purpose. (LV2013).

 

(no local variables, no sequences, no references, no clusters, no case structures, no subVIs, etc...!)

 

 

 

 

Download All
Message 4 of 14
(4,690 Views)

Hello,

I have made little modifications to ur vi. I want to check the rotation of both the graphs,but in xy graph 2  x- axis scale should be 0 to 360 but it is -180 to 180.Im a beginner kindly help me to make angles range from 0 to 360.

0 Kudos
Message 5 of 14
(4,635 Views)
Solution
Accepted by topic author Venkateshnenavath

Well, that's the way the angle of complex numbers wraps.

Why did you set r=3 by default? Just to make sure we cannot see the data? 😄

Why not keep the diagram clean and replace the bundle with "RE/IM to complex"

You shoud use Q&R to divide the angle array by 360 and use the remainder to wrap it correctly. (See picture)

 

 

 

Message 6 of 14
(4,587 Views)

Thank u  for the solution sir....r=3 was a mistake Smiley Wink

0 Kudos
Message 7 of 14
(4,537 Views)

Sir if I want to get a mirror image of xy graph into a other graph what can be done? Mirror image with respect to vertical axis.

0 Kudos
Message 8 of 14
(4,528 Views)

Hello,

If we multiply real part with -1 and imaginary with 1 we will get mirrored complex number. Is it how its done? Or any other alternative

0 Kudos
Message 9 of 14
(4,493 Views)

You could just go to the plot graph properties and go to the "scales" tab.. Enable the item named "inverted". It will invert the axis.

Message 10 of 14
(4,464 Views)