Author |
Topic |
|
Giammy85
United Kingdom
4 Posts |
Posted - 03/03/2011 : 2:16:41 PM
|
I have a column with angles in deg that I have to normalize to 0->360deg. If in "set column values" I use rmod[col(x),360] then I have angles that span -360 +360! Basically, something like -380 must be turned to 340; how can you do that in Origin? Thanks
Origin Ver. and Service Release (Select Help-->About Origin): v8.0 Operating System: Windows7 |
|
larry_lan
China
Posts |
Posted - 03/04/2011 : 02:44:27 AM
|
You need condition statement. If you are using the Set Column Value dialog, try this formula (suppose col(a) is source data):
mod(col(a),360)>0?mod(col(a),360):(360+mod(col(a),360))
Thanks Larry |
Edited by - larry_lan on 03/04/2011 9:21:33 PM |
|
|
Giammy85
United Kingdom
4 Posts |
Posted - 03/04/2011 : 07:00:18 AM
|
That works fine, thanks Larry |
|
|
Giammy85
United Kingdom
4 Posts |
Posted - 03/04/2011 : 08:15:23 AM
|
Now I have angles for which is more convenient plotting them in the region -180->180deg.
Basically, if I have an angle<-180 then I should add 360 to it, if I have an angle>180 then I should subtract 360 to it.
it should be something like that -180<rmod(col(a),360)<180?rmod(col(a),360): ..... else if -180>rmod(col(a),360) => ( 360+rmod(col(a),360)) 180<rmod(col(a),360) => (-360+rmod(col(a),360))
how can I do that? |
|
|
larry_lan
China
Posts |
Posted - 03/05/2011 : 02:03:01 AM
|
Supposed now col(b) was normalized to [0, 360], transform col(b) into col(c) as:
col(b)<=180?col(b):col(b)-360
Larry |
|
|
Giammy85
United Kingdom
4 Posts |
Posted - 03/06/2011 : 2:26:28 PM
|
oh yes, thanks Larry |
|
|
|
Topic |
|