Dear
ferreters,
I tried to compute the direction of the current vectors from
u,v components. I need to add some degrees, like 180,360,0 to
the calculated direction angle based on the positive and
negative signs of the U and V velocities. I tried to apply the
four conditions using if - elif- endif but i am facing error
at IF condition which i could not make out. Please try to
help me. script is as follows and data file is also attached.
************************************
file/format=delimited/delimiter=" "/var="v1,v2,v3,v4,v5,v6"
currents_data.dat
let r2d = atan2(v6,v5)*(180/3.142857)
let Q1 = r2d + 0
let Q2 = r2d + 360
let Q3 = r2d + 180
let Q4 = r2d + 180
let theta = if(v5 gt 0 and v6 gt 0) then Q1
elif(v5 lt 0 and v6 gt 0) then Q2
elif(v5 lt 0 and v6 lt 0) then Q3
elif(v5 gt 0 and v6 lt 0) then Q4
endif
list v5,v6,theta
****************************************
Thanks and
regards
Steeven Paul
NIO RC
India