%graf_sincr - uloha 103

[x,y]=meshgrid(-8:.5:8);
r=sqrt(x.^2+y.^2);
z=sin(r)./r;    %zavisle promenna

%a) prvni graf
h1=mesh(x,y,z);
colormap([0 0 .6])%tmavomodra
title('sinc(r), kde r=sqrt(x^2+y^2)')
x1=fix(numel(x)*rand(1,15));
x1=x(x1);   %15 nahodnych bodu pro x
y1=fix(numel(y)*rand(1,15));
y1=y(y1);   %15 nahodnych bodu pro y
z1=sin(sqrt(x1.^2+y1.^2))./sqrt(x1.^2+y1.^2);
hold on
h1=plot3(x1,y1,z1,'.');
set(h1,'color', [0 0 .6],'MarkerSize',15)

%b) druhy graf
figure
h2=surf(x,y,z);
colormap([.9 .5 .9])    %svetle fialova
set(h2,'EdgeColor','k')
title('sinc(r), kde r=sqrt(x^2+y^2)')

%c) treti graf
figure
[C,h3]= contour3(x,y,z,10);
colormap(hot)
clabel(fix(100*C)/100) %popisky vrstevnic jen na dve desetinna mista
title('sinc(r), kde r=sqrt(x^2+y^2)')












