LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Straight line between two polar points

Solved!
Go to solution

Hi all,

I've created a VI which would be plotting a polar curve depending on the time-distance formula. The VI has Present Mag. and Target Mag. each having its own angle (Polar form i.e. (r,theta)). I want to plot a straight line between the Present point and the Target point. I used the time-distance formula to plot the magnitude, and used the same slope for plotting angle. However, I get a curved plot as shown in the attachment.

Could anyone tell me what formula can be used to plot a straight line between the Present point and the Target point?

 

Thanks.

-FraggerFox!
Certified LabVIEW Architect, Certified TestStand Developer
"What you think today is what you live tomorrow"
0 Kudos
Message 1 of 13
(4,671 Views)
I'm not completely clear on what you're trying to do. Can you upload your VI?
0 Kudos
Message 2 of 13
(4,636 Views)
The polar plot uses a picture indicator, so all you need is append a line to the image using tools from the picture functions palette.
0 Kudos
Message 3 of 13
(4,627 Views)

@altenbach....

how can we do that?

 

To say in short,

I have two points A(magnitude1,phase1[deg]) and B(magnitude2,phase2[deg]) on the input side. Also, I have the Time input to travel from pt.A to pt.B

I have one polar plot as indicator output.

 

I need to show on the polar plot a line which is gradually increasing from pt.A to pt.B in a straight line on the polar plot.

 

You may refer the picture attached in the first post above to get an idea of what I am trying to do.

 

Thanks! 🙂

 

Message Edited by Fragger Fox on 01-13-2010 11:01 AM
-FraggerFox!
Certified LabVIEW Architect, Certified TestStand Developer
"What you think today is what you live tomorrow"
0 Kudos
Message 4 of 13
(4,599 Views)

@altenbach...

Appending a line from picture tools to the polar plot won't be good for my application, as I also need to collect all the points(in an array) through which the straight line would be travelling from pt.A to pt.B

-FraggerFox!
Certified LabVIEW Architect, Certified TestStand Developer
"What you think today is what you live tomorrow"
0 Kudos
Message 5 of 13
(4,592 Views)
Solution
Accepted by topic author FraggerFox

1. Convert your two polar points to rectangular coordinates.

2. Generate the points in between.  You could use the ramp function or a few other methods to generate the points.

3. Convert the points back to polar coordinates and plot them.  Nice straight line!!!

 

Of course, the question is why do you want a straight line when you are using polar coordinates?  It will not be straight in either r or theta.

 

Bruce

Bruce Ammons
Ammons Engineering
Message 6 of 13
(4,587 Views)

Thanks Bruce for the reply.

Would try doing this.

However, if you have a vi for this, please try to attach it.

Thanks 🙂

-FraggerFox!
Certified LabVIEW Architect, Certified TestStand Developer
"What you think today is what you live tomorrow"
0 Kudos
Message 7 of 13
(4,584 Views)

@Bruce,

I tried this, but though I am getting the magnitudes array from ramp pattern, I noticed that after polar-rectangular-polar conversion, the angle sticks at a constant value. Hence, the straight line is formed only through that fixed angle, defeating the purpose of the requirement.

-FraggerFox!
Certified LabVIEW Architect, Certified TestStand Developer
"What you think today is what you live tomorrow"
0 Kudos
Message 8 of 13
(4,577 Views)

Huh?  What do you mean about the angle sticking?  If you do the interpolation in rectangular coordinates, you will have a straight line.  If you don't, you aren't doing the interpolation correctly.  First you have to interpolate to get a list of X,Y coordinates, then convert each XY pair to polar for plotting or analysis or whatever.  Why are you doing all this anyway?  What is your ultimate goal?

 

Bruce

Bruce Ammons
Ammons Engineering
0 Kudos
Message 9 of 13
(4,572 Views)

I did the following:

Used the Starting point pt.A's magnitude and phase and converted it to rectangular co-ordinates using 1d polar to recangular pt. by pt. function. Did the same with pt. B. Now, I gave the magnitude (x) output of this function of pt.A to Ramp pattern's start and that of pt.B to its end input. SI did the same for angle. After this, I gave both, the magnitude and angle ramp outputs to for loop with indexing enabled, and plot the same on polar plot by building cluster in the loop.

 

This method is not working.

 

My ultimate aim is to trace the movement of a joystick control on the polar plot.

-FraggerFox!
Certified LabVIEW Architect, Certified TestStand Developer
"What you think today is what you live tomorrow"
0 Kudos
Message 10 of 13
(4,567 Views)