File:Triple torus illustration.png
来自Wikimedia Commons
跳转到导航
跳转到搜索
本预览的尺寸:800 × 563像素。 其他分辨率:320 × 225像素 | 640 × 450像素 | 1,024 × 720像素 | 1,280 × 900像素 | 2,204 × 1,550像素。
原始文件 (2,204 × 1,550像素,文件大小:670 KB,MIME类型:image/png)
文件信息
结构化数据
说明
描述Triple torus illustration.png | Illustration of a triple torus |
日期 | (UTC) |
来源 | 自己的作品, MATLAB source code below |
作者 | Oleg Alexandrov |
Public domainPublic domainfalsefalse |
我,本作品著作权人,释出本作品至公有领域。这适用于全世界。 在一些国家这可能不合法;如果是这样的话,那么: 我无条件地授予任何人以任何目的使用本作品的权利,除非这些条件是法律规定所必需的。 |
Source code (MATLAB)[编辑]
function main()
% illustration of a triple torus
% torus radii
r = 1;
R = 3;
Kb = R+r;
Ks = R-r;
% Km controls the smoothness of the transition from one ring to the others
Km = 0.5125*Kb;
L = 2.5*(r+R);
h = 0.2; % grid size
X = (-L):h:L; m = length(X);
Y = (-L):h:L; n = length(Y);
Z = (-1.1*r):h:(1.1*r); k = length(Z);
W = zeros(m, n, k);
for i=1:length(X)
for j=1:length(Y)
x = X(i);
y = Y(j);
[x, y] = triple_torus_function (x, y, r, R, Kb, Km);
val = (sqrt(x^2+y^2)-R)^2-r^2;
W(i, j, :) = val + Z.^2;
end
end
figure(1); clf; hold on;
axis equal; axis off;
light_green=[184, 224, 98]/256; % light green
H = patch(isosurface(X, Y, Z, W, 0));
isonormals(X, Y, Z, W, H);
mycolor = light_green;
set(H, 'FaceColor', mycolor, '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))
view(-12, 40);
% add in a source of light
camlight (-50, 54); lighting phong;
print('-dpng', '-r400', ...
sprintf('Triple_torus_illustration.png'));
function [x, y] = triple_torus_function (x, y, r, R, Kb, Km)
% a deformation in the plane, which, when comosed with a torus will give
% a triple torus
% center of one of the torii
O = [-Kb, -Kb/sqrt(3)];
angle = 2*pi/3;
Mat = [ cos(angle) -sin(angle); sin(angle) cos(angle) ];
p =[x, y]';
phi = atan2(y, x);
if phi >= pi/6 & phi <= 5*pi/6
p = Mat*p; % rotate 120 degree counterclockwise
elseif phi >= -pi/2 & phi < pi/6
p = Mat*p; p = Mat*p; % rotate 240 degrees counterclockwise
end
x=p(1); y = p(2);
% reflect against a line, to merge two cases in one
if y > x/sqrt(3)
p = [x, y];
v = [cos(2*pi/3), sin(2*pi/3)];
p = p - 2*v*dot(p, v)/dot(v, v);
x = p(1); y = p(2);
end
if x > O(1)
% project to the y axis, to a point B
if y < O(2)
A = [O(1), y];
B = [0, y];
else
A = O;
p = [x, y];
rho = norm(p-O);
B = O+(Kb/rho)*(p-O);
% t = -O(1)/(x-O(1));
% B = [0, O(2)+t*(y-O(2))];
end
p = [x, y];
d=norm(p-A);
q = norm(B-A);
d = my_map(d, q, Km);
p = (d/q)*B+(1-d/q)*A;
x=p(1); y=p(2);
end
% shift towards the origin
x = x-O(1);
y = y-O(2);
function y = my_map(x, Kb, Km)
if x > Kb
y = Km + 1;
elseif x < Km
y = x;
else
y = Km+sin((pi/2)*(x-Km)/(Kb-Km));
end
文件历史
点击某个日期/时间查看对应时刻的文件。
日期/时间 | 缩略图 | 大小 | 用户 | 备注 | |
---|---|---|---|---|---|
当前 | 2008年7月1日 (二) 03:01 | 2,204 × 1,550(670 KB) | Oleg Alexandrov(留言 | 贡献) | change viewing angle | |
2008年7月1日 (二) 02:48 | 1,958 × 1,335(530 KB) | Oleg Alexandrov(留言 | 贡献) | Implementation using isosurface. Much better quality and much simpler than using patches. Will upload source code too. Same license, public domain. | ||
2008年6月23日 (一) 04:42 | 1,320 × 1,000(366 KB) | Oleg Alexandrov(留言 | 贡献) | Fix a small imperfection in Gimp | ||
2007年9月10日 (一) 02:54 | 1,320 × 1,000(366 KB) | Oleg Alexandrov(留言 | 贡献) | Tweak | ||
2007年9月7日 (五) 18:01 | 372 × 263(49 KB) | Oleg Alexandrov(留言 | 贡献) | {{Information |Description= Illustration of en:Triple torus |Source=self-made with MATLAB, source code below |Date=~~~~~ |Author= Oleg Alexandrov }} {{PD-self}} ==MATLAB source code== <pre> <nowiki> % illustration of a tripl |
您不可以覆盖此文件。
文件用途
没有页面使用本文件。
全域文件用途
以下其他wiki使用此文件:
- ar.wikipedia.org上的用途
- ca.wikipedia.org上的用途
- cs.wikipedia.org上的用途
- cv.wikipedia.org上的用途
- de.wikipedia.org上的用途
- de.wikiversity.org上的用途
- el.wikipedia.org上的用途
- en.wikipedia.org上的用途
- en.wiktionary.org上的用途
- eo.wikipedia.org上的用途
- es.wikipedia.org上的用途
- eu.wikipedia.org上的用途
- fa.wikipedia.org上的用途
- fi.wikipedia.org上的用途
- fr.wikipedia.org上的用途
- he.wikipedia.org上的用途
- hy.wikipedia.org上的用途
- it.wikipedia.org上的用途
查看本文件的更多全域用途。