function [x,y,vx,vy]=ellip(M,a,ecc)
% function [x,y,vx,vy]=ellip(M,a,ecc)
%
% vector of location and velocity for elliptical orbits
% algorithms by Montenbruck/Pfleger: "Astronomy with the Personal Computer"
%
% 05.05.04 M.Penzkofer
% constants
KGAUSS = 0.01720209895;
rho = pi/180;
K = KGAUSS / sqrt(a);
E = eccanom(M,ecc);
C = cos(E*rho); S = sin(E*rho);
FAC= sqrt((1.0-ecc)*(1+ecc));
RHO=1.0-ecc*C;
x = a*(C-ecc);
y = a*FAC*S;
vx=-K*S/RHO;
vy= K*FAC*C/RHO;