DPlot Forum Index DPlot
http://www.dplot.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Polar Plots: Negative Angles Should Be Allowed

 
Post new topic   Reply to topic    DPlot Forum Index -> Bug Reports
View previous topic :: View next topic  
Author Message
raydela



Joined: 10 Sep 2003
Posts: 46
Location: Oxford, MI, USA

PostPosted: Wed Sep 17, 2003 11:02 am    Post subject: Polar Plots: Negative Angles Should Be Allowed Reply with quote

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
View user's profile Send private message Send e-mail MSN Messenger
DPlotAdmin
Site Admin


Joined: 24 Jun 2003
Posts: 2310
Location: Vicksburg, Mississippi

PostPosted: Wed Sep 17, 2003 4:48 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    DPlot Forum Index -> Bug Reports All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
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