lab 3D plotting-1
lab 3D plotting-1
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:
Output:
wxdraw3d (enhanced3d= true, color= green, cbrange = [-3,10], explicit(x^2+y^2, x,-2,2,y,-2,2)) $
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:
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:
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));