na=30;vv=0.5;
lx=(xmax-xmin)/na;
ly=(ymax-ymin)/na;
kxy=ly/lx;

[xp,yp]=ginput(1);
up=fun00a(0,[xp,yp]);xp1=kxy*up(1);yp1=up(2);
vinki=1;
if xp1*xp1+yp1*yp1==0, vinki=0;
 else
   if xp1>0, vink=atan(yp1/xp1);end
   if xp1<0, vink=atan(yp1/xp1)+pi;end
   if xp1==0,
      if yp1>0, vink=pi/2; else vink=3*pi/2; end, end
end
vinki, vink

   

%ll=lx+(ly-lx)*abs(sin(vink));

xpp(2)=xp;ypp(2)=yp;

if p>0,
xpp(1)=xp+lx*cos(vink+pi-vv);
xpp(3)=xp+lx*cos(vink+pi+vv);
ypp(1)=yp+ly*sin(vink+pi-vv);
ypp(3)=yp+ly*sin(vink+pi+vv);
else
xpp(1)=xp+lx*cos(vink-vv);
xpp(3)=xp+lx*cos(vink+vv);
ypp(1)=yp+ly*sin(vink-vv);
ypp(3)=yp+ly*sin(vink+vv);
end
plot(xpp,ypp)
