function F=ellipticF(phi,k)
% F(phi,k)=integrate(1/sqrt(1-k sin(u)^2),u,[0,phi])
% Usage:: F=ellipticF(phi,k)

% revision history:
% 07/17/04 Mark D. Shattuck <mds> ellipjj.m
%          taken from Numerical Recipies 2nd Ed.
% 07/18/04 mds k->k^2 for NR notation

%% main

s=sin(phi);
u=s.*sqrt(k);
F=s.*rf(cos(phi).^2,(1-u).*(1+u),1);
