View previous topic :: View next topic |
Author |
Message |
raydela
Joined: 10 Sep 2003 Posts: 46 Location: Oxford, MI, USA
|
Posted: Sat May 05, 2012 4:27 am Post subject: Polar Plots - Option to Handle Negative Radius Values |
|
|
Hello,
I ran into a situation where I have a polar equation which can generate negative radius (Y) values for some ranges of angle (X).
Can you add an option on the Linear/Log Scaling | L. Polar Coordinates | Polar Options dialog to "Force Positive Radial Values" (or some such name) which will convert an (X,-Y) (i.e. theta, -R) point into (X+Pi,+Y) point (assuming angle in radians)?
Plot the following example: Y = 1/(1+1.2*Cos(X)) for x = 0 to 2*pi (every 0.01 radians). This is a polar equation for a hyperbola.
The auto scaling initially creates a polar chart having large positive & negative R values. If you then manually rescale for r= -10 to r = +10, for example, you can see the 'two pieces' of the hyperbola, although distorted. The 2nd piece of the hyperbola is 'mapped' in the negative radius area, but I want to have this 'mapped' in the positive radius area, but with each theta flipped 180 degrees (only if original r is negative).
Also, when polar coordinates are selected, how difficult would it be for you to make the Y = F(X) dialog refer to r = (instead of Y=) and "from theta =," "to theta =", and "with interval dtheta" (except show the actual symbol for theta in dialog AND CURVE LEGEND)? In polar charts I always need to change the default "x" symbol to a "theta" symbol for the legend text.
Ray D. |
|
Back to top |
|
|
DPlotAdmin Site Admin
Joined: 24 Jun 2003 Posts: 2311 Location: Vicksburg, Mississippi
|
Posted: Sat May 05, 2012 11:31 am Post subject: |
|
|
Ray,
I don't know that I'd want to automatically shift things like that, but you can manually do it unless I misunderstand. Use Edit>Operate on X with X=if(Y<0,X+pi,X) and then Operate on Y with Y=abs(Y).
Good point about the legend (the dialog, too). The only problem is you'll need to set the scaling to polar first, because once the legend is created the text there is just a bunch of characters as far as DPlot is concerned. _________________ Visualize Your Data
support@dplot.com |
|
Back to top |
|
|
DPlotAdmin Site Admin
Joined: 24 Jun 2003 Posts: 2311 Location: Vicksburg, Mississippi
|
Posted: Sat May 05, 2012 2:29 pm Post subject: |
|
|
This is done, now, for the legend. But I think I'll likely leave the dialog box alone, otherwise it is too confusing. You don't want the equation to be a function of X but the limits shown as theta. And there's no ASCII theta character you could use in the equation. _________________ Visualize Your Data
support@dplot.com |
|
Back to top |
|
|
raydela
Joined: 10 Sep 2003 Posts: 46 Location: Oxford, MI, USA
|
Posted: Sat May 05, 2012 2:59 pm Post subject: |
|
|
Thanks for your quick reply!
Your solution (Operate on X and Operate on Y) worked just fine.
Could this behavior be made into a 'check box' option on the 'Polar Options' dialog though?
Since negative distance is not permitted in polar coordinates, the convention is to interpret it as a positive distance 180 degrees away.
I will e-mail you a 'before' and 'after' plot to show that using this convention plotted my hyperbola (both 'pieces' that is) in an undistorted way.
Regarding theta vs X, r vs Y: I can see where this could be pretty messy since you would need to make many changes through out DPlot because there are many reference to X and Y in menus, etc.
As far as the theta character, I had to use the 'Insert Symbol' dialog (selected by a button with an 'alpha' character on it), but I see what you mean - the insertion did not place a 'theta' in my equation in the dialog's edit box but rather it placed a text string which is interpreted as a theta when displayed in the legend.
Ray D. |
|
Back to top |
|
|
DPlotAdmin Site Admin
Joined: 24 Jun 2003 Posts: 2311 Location: Vicksburg, Mississippi
|
Posted: Sat May 05, 2012 4:03 pm Post subject: |
|
|
Quote: | Since negative distance is not permitted in polar coordinates... |
That's what you and I think because we have similar backgrounds. But for RF and EE guys and others there is nothing unusual about negative radii. But your suggestion to add an option to handle this is easy enough and I'll give it a go. _________________ Visualize Your Data
support@dplot.com |
|
Back to top |
|
|
DPlotAdmin Site Admin
Joined: 24 Jun 2003 Posts: 2311 Location: Vicksburg, Mississippi
|
Posted: Sat May 05, 2012 5:58 pm Post subject: |
|
|
Thanks for your e-mail examples. I've added a "Transform negative radii to angle+PI, abs(radius)" option to the polar plot options. It operates a bit differently than the others in that it actually performs this operation on the data and is therefore not reversible (other than using Undo). In other words checking this option then later unchecking it has no effect. I tried just using this manipulation on the scaling and leaving the data alone, but that leads to a lot of confusion: mins/maxes, mean, standard deviation and other values would not be right - or at least not consistent.
This change will be in the next release. _________________ Visualize Your Data
support@dplot.com |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|