Lara - 2009-02-28

Hello,

I am a beginner using gnuplot. I would like to know how to express the command IF (like in fortran) in Gnuplot. I have read in the tutor something about the ternary operator but for simple cases it is very clear, but when I want to introduce an IF BLOCK inside another IF BLOCK it is no so easy, I am not sure if I am right. Might anybody help me? This is what I want to express:

I have the following function:

a(y,w,d)=(acos((w-y)/d)*d**2-sin(acos((w-y)/d))*(w-y)*d)

and I want to evaluate and then

IF (w-y)<d then
       IF (w-y)>0 then
      Gnuplot muss evaluate a(y,w,d)
      else is pi*d^2
else cero.

Then my attempt is

A(y,w,d)=(w-y<d)?(w-y>-d?a(y,w,d):pi*d**2):0

Is it right?