View previous topic :: View next topic |
Author |
Message |
raydela
Joined: 10 Sep 2003 Posts: 46 Location: Oxford, MI, USA
|
Posted: Wed Sep 17, 2003 11:02 am Post subject: Polar Plots: Negative Angles Should Be Allowed |
|
|
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 |
|
Back to top |
|
|
DPlotAdmin Site Admin
Joined: 24 Jun 2003 Posts: 2310 Location: Vicksburg, Mississippi
|
Posted: Wed Sep 17, 2003 4:48 pm Post subject: |
|
|
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 |
|
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
|