30 plotting
Exercise 4: 3 d plotting
- Plot the following 3dcurves using theplot3function:
a) Spherical helix
x=sin
(
t
2c
)
cos(t)
y=sin
(
t
2c
)
sin(t)
z=cos
(
t
2c
)
wherec= 5 and 06 t 6 10π.
b) Sine wave on a sphere
x=cos(t)
√
b^2 −c^2 cos^2 (at)
y=sin(t)
√
b^2 −c^2 cos^2 (at)
z=c∗cos(at)
wherea= 10 ,b= 1 ,c=0.3, and 06 t 6 2π.
- Plot the following surfaces using thesurffunction:
a) Sine surface
x=sin(u)
y=sin(ν)
z=sin(u+ν)
where 06 u 6 2π, and 06 ν 6 2π.
b) Spring
x=[ 1 −r 1 cos(ν)]cos(u)
y=[ 1 −r 1 cos(ν)]sin(u)
z=r 2
[
sin(ν) +
tu
π
]
wherer 1 =r 2 =0.5,t=1.5, 06 u 6 10π, and 06 ν 6 10π.
c) Elliptic torus
x=[c+cos(ν)]cos(u)
y=[c+cos(ν)]sin(u)
z=sin(ν)cos(ν)
wherec=0.5,−π 6 u 6 π, and 06 ν 6 π.