Image:Surface vectors.png

From Wikipedia, the free encyclopedia

Wikimedia Commons logo This is a file from the Wikimedia Commons. The description on its description page there is shown below.
Commons is a freely licensed media file repository. You can help.
Description
Source No source specified. Please edit this image description and provide a source.
Date
Author
Permission
(Reusing this image)

see below


Public domain I, the copyright holder of this work, hereby release it into the public domain. This applies worldwide.

In case this is not legally possible:
I grant anyone the right to use this work for any purpose, without any conditions, unless such conditions are required by law.


Afrikaans | Alemannisch | Aragonés | العربية | Asturianu | Български | Català | Česky | Cymraeg | Dansk | Deutsch | Eʋegbe | Ελληνικά | English | Español | Esperanto | Euskara | Estremeñu | فارسی | Français | Galego | 한국어 | हिन्दी | Hrvatski | Ido | Bahasa Indonesia | Íslenska | Italiano | עברית | Kurdî / كوردی | Latina | Lietuvių | Latviešu | Magyar | Македонски | Bahasa Melayu | Nederlands | ‪Norsk (bokmål)‬ | ‪Norsk (nynorsk)‬ | 日本語 | Polski | Português | Ripoarisch | Română | Русский | Shqip | Slovenčina | Slovenščina | Српски / Srpski | Svenska | ไทย | Tagalog | Türkçe | Українська | Tiếng Việt | Walon | ‪中文(简体)‬ | ‪中文(繁體)‬ | zh-yue-hant | +/-


% illustration of a vector field on a surface
figure(1); clf; hold on; axis equal; axis off;
view(-12, 20) % viewing angle

% initial data
f=inline('0.4*(1-(X.^2+1.1*Y.^2))'); % the function to be plotted
fx=inline('-2*X', 'X', 'Y'); fy=inline('-2.2*Y', 'X', 'Y');

Lx1=0; Lx2=1; Ly1=-1; Ly2=1; % the domain of f is the box [Lx1 Lx2] x [Ly1 Ly2]

% plot the surface
N=50; [X, Y]=meshgrid(Lx1:1/N:Lx2, Ly1:1/N:Ly2); Z=f(X, Y); % X and Y
                 surf(X, Y, Z, 'FaceColor','red', 'EdgeColor','none', ...
                          'AmbientStrength', 0.3, 'SpecularStrength', 1, 'DiffuseStrength', 0.8);

% create and plot a vector field (rather arbitrarily)
lw=1.4; % width of vectors
N=3; [X, Y]=meshgrid(Lx1:1/N:Lx2, Ly1:1/N:Ly2); Z=f(X, Y); % X and Y
Vx=fy(X, Y); Vy=-0.5*fx(X, Y); Vz=3+0*Vx;
H=quiver3(X, Y, Z, Vx, Vy, Vz); % draw the normals
set(H(1), 'linewidth', lw); set(H(2), 'linewidth', lw);

camlight headlight; lighting phong; % make nice lightning

saveas(gcf, 'surface_vectors.eps', 'psc2');
print('-dpng',  '-r300', 'surface_vectors.png') % save to file.

File history

Click on a date/time to view the file as it appeared at that time.

Date/TimeDimensionsUserComment
current22:41, 23 April 20071,455×807 (80 KB)Oleg Alexandrov ({{Information |Description= |Source= |Date= |Author= }} {{PD-self}})
The following pages on the English Wikipedia link to this file (pages on other projects are not listed):