File:Spherical mean.png
![]() |
I, the copyright holder of this work, release this work into the public domain. This applies worldwide. In some countries this may not be legally possible; if so: I grant anyone the right to use this work for any purpose, without any conditions, unless such conditions are required by law. |
Source code (MATLAB)
L=5;
N=100;
h=L/N;
r=3;
f=inline('10-(x.^2-y.^2)/15', 'x', 'y');
blue=[0, 0, 1];
red =[1, 0, 0];
black=[0, 0, 0];
lw=1;
fs=20;
tiny1=0.01;
tiny2=0.03;
tiny3=0.02;
XX=-L:h:L;
YY=-L:h:L;
[X, Y]=meshgrid(XX, YY);
Z=f(X, Y);
W = Z*0;
Theta=0:h:2.2*pi;
XC=r*cos(Theta); YC = r*sin(Theta);
ZC = f(XC, YC);
figure(1); clf; hold on; axis equal; axis off;
%view (-34, 44);
view (108, 36);
surf(X, Y, Z, 'FaceColor','red', 'EdgeColor','none');
camlight right; lighting phong; % make nice lightning
% the box at the bottom
XD=[-L, L, L, -L, -L];
YD=[-L, -L, L, L, -L];
ZD=XD*0;
plot3(XD, YD, ZD, 'color', black, 'linewidth', 2*lw);
% the circle on top, and a tiny dot
plot3(XC, YC, ZC+tiny1, 'color', blue, 'linewidth', 3*lw);
fill3(tiny2*XC, tiny2*YC, f(tiny2*XC, tiny2*YC)+2*tiny1, blue, 'LineWidth', 1e-4);
% plot the base circle and a tiny dot
plot3(XC, YC, 0*ZC, 'color', blue, 'linewidth', 3*lw);
H=fill3(tiny2*XC, tiny2*YC, 0*ZC, blue, 'LineWidth', 1e-4);
get(H)
print('-dpng', '-r300', 'spherical_mean.png') % save to file.
![]() |
This math image could be re-created using vector graphics as an SVG file. This has several advantages; see Commons:Media for cleanup for more information. If an SVG form of this image is available, please upload it and afterwards replace this template with {{vector version available|new image name}} .It is recommended to name the SVG file “Spherical mean.svg”—then the template Vector version available (or Vva) does not need the new image name parameter. |
Category:Files by User:Oleg Alexandrov from en.wikipedia
Category:Files with no machine-readable author
Category:Files with no machine-readable source
Category:Images with Matlab source code
Category:Math images that should use vector graphics
Category:Media missing infobox template
Category:PD-self
Category:PNG that should use vector graphics
Category:Partial differential equations
Category:Self-published work
Category:Surface plots