Original file(1,455 × 807 pixels, file size: 80 KB, MIME type: image/png)

Description
العربية: مجال متجه لسطح.
Català: Un camp vectorial sobre una superfície.
English: A vector field on a surface.
Esperanto: Vektora kampo sur surfaco.
ភាសាខ្មែរ: ដែនវ៉ិចទ័រនៅលើផ្ទៃ.
中文:曲面上的向量场。.
Source Own work
Author Oleg Alexandrov
 
This diagram was created with MATLAB.
Public domain 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)

 

% 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.
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 “Surface vectors.svg”—then the template Vector version available (or Vva) does not need the new image name parameter.

Captions

Add a one-line explanation of what this file represents

Items portrayed in this file

depicts

File history

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

Date/TimeThumbnailDimensionsUserComment
current22:41, 23 April 2007Thumbnail for version as of 22:41, 23 April 20071,455 × 807 (80 KB)Oleg Alexandrov{{Information |Description= |Source= |Date= |Author= }} {{PD-self}}

The following page uses this file:

Global file usage

The following other wikis use this file: