File:Torus illustration.png

原始文件(900 × 594像素,文件大小:147 KB,MIME类型:image/png


 
本PNG 位图使用MATLAB创作.
描述 Illustration of torus
日期 (UTC)
来源 self-made, with MATLAB
作者 Oleg Alexandrov
其他版本 此文件衍生的作品:  Infobox torus.png
Public domain 我,本作品著作权人,释出本作品至公有领域。这适用于全世界。
在一些国家这可能不合法;如果是这样的话,那么:
我无条件地授予任何人以任何目的使用本作品的权利,除非这些条件是法律规定所必需的。

Source code

% illustration of a torus, obtained as an isosurface
function main()

   % big and small radii of the torus
   R = 3; r = 1; 

   Kb = R+r;
  
   h = 0.1; % h is the grid size. Smaller h means prettier picture.
   
   X = (-Kb-h):h:(Kb+h);   m = length(X);
   Y = (-Kb-h):h:(Kb+h);   n = length(Y);
   Z = (-r-h):h:(r+h);     k = length(Z);
 
   W = zeros(m, n, k); % the zero level set of this function will be the desired shape
 
   for i=1:m
      for j=1:n
         x = X(i);
         y = Y(j); 
         W(i, j, :) = (sqrt(x^2+y^2)-R)^2 + Z.^2-r^2; % torus eqn, vectorize in Z
      end
   end

   figure(4); clf; hold on; axis equal; axis off;

   H = patch(isosurface(W, 0));
   isonormals(W, H);
      
   light_green=[184, 224, 98]/256;

   % set some propeties
   set(H, 'FaceColor', light_green, 'EdgeColor','none', 'FaceAlpha', 1);
   set(H, 'SpecularColorReflectance', 0.1, 'DiffuseStrength', 0.8);
   set(H, 'FaceLighting', 'phong', 'AmbientStrength', 0.3);
   set(H, 'SpecularExponent', 108);

   daspect([1 1 1]);
   axis tight;
   colormap(prism(28))
      
  % viewing angle
   view(-146, 32);

  % add in a source of light
   camlight (-10, 54); lighting phong;

  %save as png
  print('-dpng', '-r400', sprintf('Torus_illustration.png'));

说明

添加一行文字以描述该文件所表现的内容

此文件中描述的项目

描绘内容

环面 中文(已转写)

文件历史

点击某个日期/时间查看对应时刻的文件。

日期/时间缩⁠略⁠图大小用户备注
当前2008年7月13日 (日) 01:122008年7月13日 (日) 01:12版本的缩略图900 × 594(147 KB)Oleg Alexandrov{{Information |Description=Illustration of torus |Source=self-made, with MATLAB |Date=~~~~~ |Author= Oleg Alexandrov }} {{PD-self}} ==Source code== <source lang="matlab"> % illustration of a torus, o

以下页面使用本文件:

全域文件用途

以下其他wiki使用此文件:

查看本文件的更多全域用途