No loop construct is necessary. Assuming that h, and d are constants defined at toplevel, and that you have the functions x
, y
and yy
defined, you could proceed as follows:
hsq = h^2
xlist = x[...]
ylist = y[...]
yylist = yy[...]
xx[x_, y_, yy_] := x/(Sqrt[hsq + d^2 + y^2])*(Sqrt[hsq + (d + yy)^2])
xxlist = MapThread[xx, {xlist, ylist, yylist}]
The MapThread
function will pluck successive items from xlist
, ylist
, and yylist
, pass them to xx
and gather up the computed values in a list which it returns.
This isn't the most sophisticated way to solve your problem with Mathematica, but at this point of your Mathematica experience, it may be the quickest and easiest way for you to do the calculations you want to carry out.
Your expression for xx isn't syntactically correct. I made a guess about where the parentheses go. Another interpretation I could have made is
xx[x_, y_, yy_] := x/((Sqrt[hsq + d^2 + y^2])*(Sqrt[hsq + (d + yy)^2]))
Use whichever is correct.