0% found this document useful (0 votes)
20 views

lab 3D plotting-1

656

Uploaded by

ARIF K F
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views

lab 3D plotting-1

656

Uploaded by

ARIF K F
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 13

3D plotting

2 2
1) Plot the surface 𝑢 − 𝑣 .
kill(all)$
wxplot3d (u^2 - v^2, [u, -2, 2], [v, -3, 3], [grid, 100, 100], [mesh_lines_color,false])$

kill(all)$
wxplot3d (u^2 - v^2, [u, -2, 2], [v, -3, 3], [grid, 100, 100])$
Output:
2) Plot the surface log 𝑥 2 𝑦 2.
kill(all)$
wxplot3d ( log ( x^2*y^2 ), [x, -2, 2], [y, -2, 2], [z, -8, 4], [palette, false], [color, red])$
Output:

kill(all)$
plot3d (log (x^2*y^2), [x, -2, 2], [y, -2, 2],[grid, 29, 29], [palette, [gradient, red, orange, yellow, green]],
color_bar, [xtics, 1], [ytics, 1], [ztics, 4], [color_bar_tics, 4])$
3) Plot the sphere 𝑥 2 +𝑦 2 + 𝑧 2 = 25
wxplot3d ( 5, [theta, 0, %pi], [phi, 0, 2*%pi], same_xyz, [transform_xy, spherical_to_xyz],
[mesh_lines_color,blue])$

Output:

4) Plot the surface 𝑧 = 𝑥 2 +𝑦 2


wxdraw3d(explicit(x^2+y^2,x,-1,1,y,-1,1));

Output:
wxdraw3d (enhanced3d= true, color= green, cbrange = [-3,10], explicit(x^2+y^2, x,-2,2,y,-2,2)) $
Output:

wxdraw3d (enhanced3d = true, color= green, cbtics = {["High",10],["Medium",05],["Low",0]},cbrange = [0, 10],


explicit(x^2+y^2, x,-2,2,y,-2,2)) $
Output:
2 2
5) Plot the surfaces sin 𝑥𝑦 𝑎𝑛𝑑 20 𝑒 −𝑥 −𝑦 − 10.
wxdraw3d(enhanced3d = sin(x*y), explicit(20*exp(-x^2-y^2)-10, x ,-3, 3, y, -3, 3)) ;
Output:

2 2
6) Plot the surface 20 𝑒 −𝑥 −𝑦 − 10.
wxdraw3d(
explicit(20*exp(-x^2-y^2)-10, x ,-3, 3, y, -3, 3)) ;
Output:
7) Plot/draw the cylinder of base radius equal to one.

draw3d(cylindrical(1,z,-2,2,a,0,2*%pi))$

Output:

8) Plot/draw the sphere of radius equal to five.

kill(all)$
load(draw)$
wxdraw3d(spherical(5,a,0,2*%pi,b,0,%pi));
Output:
9) Draw the plane 2𝑥 + 3𝑦 + 4𝑧 − 12 = 0.
kill(all)$
load(draw)$
wxdraw3d(color=red, implicit(2*x+3*y+4*z-12,x,0,2,y,0,8,z,0,2));

2 2
10) Plot the surfaces 20 𝑒 −𝑥 −𝑦 − 10 and the plane 𝑧 = 𝑥 + 𝑦 .
wxdraw3d(key = "Gauss", color = "magenta",explicit(20*exp(-x^2-y^2)-10,x,-3,3,y,-3,3), yv_grid = 10,
color = blue, key = "Plane",
explicit(x+y,x,-5,5,y,-5,5),
surface_hide = true)$
Output:
11) Draw the qudrailaterals with vertices Q1=[[1,1,3],[7,3,1],[12,-2,4],[15,0,5]],
Q2= [[2,7,8],[4,3,1],[10,5,8], [12,7,1]] and Q3=[[-2,11,10],[6,9,5],[6,15,1], [20,15,2]]
wxdraw3d( mesh([[1,1,3],[7,3,1],[12,-2,4],[15,0,5]], [[2,7,8],[4,3,1],[10,5,8], [12,7,1]],
[[-2,11,10],[6,9,5],[6,15,1], [20,15,2]])) $
Output:

12) Draw the qudrailaterals with vertices [1,0,0],[0,1,0],[0,0,1],[1,1,1].


wxdraw3d( line_width = 2,
mesh([[1,0,0],[0,1,0]],
[[0,0,1],[1,1,1]])) $
Output:
13) Draw two qudrailaterals one in red and another in blue.
wxdraw3d( surface_hide = true, line_width = 3, color = red, mesh([[0,0,0], [0,1,0]], [[2,0,2], [2,2,2]]),
color = blue, mesh([[0,0,2], [0,1,2]], [[2,0,4], [2,2,4]])) $
Output:

14) Draw the surfaces/curves


2
a) 𝑒 sin 𝑥+cos 𝑥 b) cos(5𝑢)2 , sin 7𝑢 , 𝑢 − 2 c) 𝑡 2 , sin 𝑡 , 𝑡 + 2
wxdraw3d(explicit(exp(sin(x)+cos(x^2)),x,-3,3,y,-3,3), color = royalblue, parametric(cos(5*u)^2,sin(7*u),u-2,u,-2,2),
color =red, line_width = 2, parametric(t^2,sin(t),2+t,t,0,2), surface_hide =true, title = "Surface & curves" )$
Output:
15) Draw Asia map.
load(worldmap)$ wxdraw3d(geomap(Asia), /* default projection */
geomap(Asia, [spherical_projection,2,2,2,3]))$
Output:

load(worldmap)$
wxdraw3d(geomap(Australia), /* default projection */ geomap(Australia, [cylindrical_projection,2,2,2,3,8]))$
16) Draw a Helix
kill(all)$
load(draw)$
wxdraw3d(xrange=[-2,2], yrange=[-2,2], zrange=[0,50], nticks=100, parametric(cos(t), sin(t),t,t,0,10*%pi));

17) Draw a cylinder of base radius 3 and sphere of radius 3. Give two different colours to the sufaces.
kill(all)$
load(draw)$
wxdraw3d(color=blue, cylindrical(3,b,-4,4,a,0,2*%pi),color=red, spherical(3,a,0,2*%pi,b,0,%pi));
18) Draw two spheres with radius 2 and 3.
kill(all)$
load(draw)$
wxdraw3d(color=blue, spherical(3,a,0,2*%pi,b,0,%pi),color=green, spherical(2,a,0,2*%pi,b,0,%pi));

19) Draw two cylinders of different base radius and colour.


kill(all)$
load(draw)$
wxdraw3d(color=magenta, cylindrical(6,b,-4,4,a,0,2*%pi),
color=green, cylindrical(3,b,-4,4,a,0,2*%pi));
20) Draw the surface 𝑧 − 𝑥 2 − 𝑦 2 inside a cylinder.
kill(all)$
load(draw)$
wxdraw3d(color=black, implicit(z-x^2-y^2,x,-2,2,y,-2,2,z,0,5),color=brown, cylindrical(3,b,0,3,a,0,2*%pi));

21) Draw the plane 2𝑥 + 3𝑦 + 4𝑧 − 12 = 0 and a cylinder of base radius 2.


kill(all)$
load(draw)$
wxdraw3d(color=red, implicit(2*x+3*y+4*z-12,x,0,2,y,0,8,z,0,2),color=black, cylindrical(2,b,0,1,a,0,2*%pi));

You might also like