Graphics Reference
In-Depth Information
the graph is shown in figure
3-16
.
Figure 3-16.
eXerCISe 3-6
Create the graph of the surface of revolution that is turning the function sine (x) around the Z axis. also create the
graph of the surface of revolution rotating the function e ^ x around the Y axis.
to obtain the equation of the surface, on the assumption that the rotation is around the
Z
axis, consider the graph
of the generating curve
y = r(z)
in the plane
YZ
. turning this graph around the
Z
axis forms a surface of revolution.
the sections with flat
z = z0
are circles whose raDius is
r (z
0
)
and equation
x
2
+ y
2
= [r(z
0
)]
2
. that means that the
equation
x
2
+ y
2
= [r (z)]
2
describes the points on the surface of revolution. for our problem, we have
r (z) = Sine (z)
and the curve x
2
+ y
2
= sine [z]
2
, which are parametric for the purpose of input for matlaB graphics:
>> r =(0:0.1:2*pi)';
>> t =(-pi:0.1:2*pi);
>>
X
= cos (r)*sin (t);
>>
Y
= sin(r)*sin (t);
>>
Z
= ones (1, size (r))'* t;
>> surf(X,Y,Z), shading interp
this generates the graph in figure
3-17
.