Polar Plots: Negative Angles Should Be Allowed

Found a bug? Tell us about it here

Moderator: DPlotAdmin

Post Reply
raydela
Posts: 46
Joined: Wed Sep 10, 2003 2:01 pm
Location: Oxford, MI, USA

Polar Plots: Negative Angles Should Be Allowed

Post by raydela »

Hello,

Some of my "Polar plots with Excel data source" applications require that raw data of certain curve(s) get offset (rotated) by an angle for comparison purposes.
This works fine if the shift is CCW, but if I want to shift CW, inevitably, one or more angles will results in a negative value and produce an error. I realize that I could (and did) make an equivalent shift by adding 360 (X=X+[360-shift]), but in my case this makes for much more work in Excel:

Examples of Excel Cell data effort required, where the raw data angle(deg) is at cell RC[-18] and trial offset angle is in Cell RC[-1].
(This example shows only (1) angle. My application has 8 Parts X 8 data points/part X 3 Tests/part = 192 cells requiring such an entry!

DPlot Now:
=IF((RC[-18]+RC[-1])*PI()/180 < 0, (RC[-18]+RC[-1]+360)*PI()/180,(RC[-18]+RC[-1])*PI()/180)

If DPlot allowed (and normalized) negative angles:
=(RC[-18]+RC[-1])*PI()/180)

(If DPlot normalized neg. angles AND allowed persistent degree units, cell would be "=RC[-18]+RC[-1]"

The same problem applies if one is using "Edit | Operate on X..." from within DPlot to shift angles:
"Edit | Operate on X..." and enter X=X+shift value -- ANY shift value is fine, however...
"Edit | Operate on X..." and enter X=X-shift value -- an error can result.

Changing DPlot to handle both (+) and (-) angles should be simple (I've had to do it in other software). Here is a method I've used in a Pascal based program to normalize angles:

{* Remove rotations >1 (i.e. result is in range of -360 to +360) *}
x := 360.0*frac(x/360.0);
{* Ensure positive angle (i.e. result is in range of 0 to 360) *}
if (x < 0.0) then
x:=x+360.0;

Of course, substitute all 360's with 2*Pi if angles are in radians.

Keep up the good work -- I look forward to the next revision.

Ray
User avatar
DPlotAdmin
Posts: 2312
Joined: Tue Jun 24, 2003 9:34 pm
Location: Vicksburg, Mississippi
Contact:

Post by DPlotAdmin »

Hmm... after looking at the code I'm not real sure why that limitation was ever put in there. Negative angles don't foul up the scaling; they work fine. This has been changed. Thanks for the input.
Visualize Your Data
support@dplot.com
Post Reply