From Wikipedia, the free encyclopedia
Right circular cylinder, created in Matlab by Jitse Niesen.
[edit] Licensing
[edit] Source
clf;
colormap([1 0 0]);
[cx,cy,cz] = cylinder([0.2 0.2], 100);
cc = ones(size(cx));
% rotate by 70 degrees around y axis
M = [ cos(7/18*pi) sin(7/18*pi); -sin(7/18*pi) cos(7/18*pi) ];
for k = 1:size(cx,1)
for l = 1:size(cx,2)
v = M * [cx(k,l); cz(k,l)];
cx(k,l) = v(1);
cz(k,l) = v(2);
end
end;
surf(cx,cy,cz, cc, 'EdgeColor', 'none', 'FaceColor', 'flat', ...
'FaceLighting', 'phong');
view(3);
camlight left;
axis equal;
axis off;
print -dpng cyl_tmp.png
system('convert -trim -border 20 -bordercolor white -transparent white cyl_tmp.png cyl.png');
File links
The following pages on the English Wikipedia link to this file (pages on other projects are not listed):