Parametrizing a lamp To parametrize a lamp like the one show
Parametrizing a lamp. To parametrize a lamp like the one shown in the figures below we first note that it is composed of 6 parts: three disks, one ring, part of a cone, and a revolved surface.
• Base Ring: The torus shaped at the bottom is obtained from revolving the circle on the yz-plane of radius 0.25 centered at the point (y, z) = (1.25, 0) about the z-axis.
• Base Disk: There is a disk at the bottom of the lamp (hard to see on the figures) on the xy-plane of radius 1 centered at the origin.
• Middle Disk: There is a disk on the plane z = 5.5 of radius 4 centered at (0, 0, 5.5).
• Top Disk: The disk at the very top is on the plane z = 10.5 of radius 3 centered at (0, 0, 10.5).
Solution
%Parametrizing a lamp.
%The body: from z=0 to z=2*pi
syms x y z t %parametres
%y=(2*pi-z).*sin(z);
hold on;
%revolving:
ezsurf((2*pi-z)*sin(z)*cos(t),(2*pi-z)*sin(z)*sin(t),z,[0,2*pi,0,2*pi]);
%Base ring
ezsurf((1.25+0.25*cos(t))*cos(z),(1.25+0.25*cos(t))*sin(z),0.25*sin(t));
%base disk:
theta=0:pi/120:360;
X=1*cos(theta);
Y=1*sin(theta);
fill(X,Y,\'b\');
%middle disk
X=4*cos(theta);
Y=4*sin(theta);
Z=ones(1,13751)*5.5;
fill3(X,Y,Z,\'g\');
%top disk
X=3*cos(theta);
Y=3*sin(theta);
Z=ones(1,13751)*10.5;
fill3(X,Y,Z,\'r\');
%part of the cone:
ezsurf((20-z)/5*cos(t),(20-z)/5*sin(t),z,[5.5,10.5]);
