/* [wxMaxima batch file version 1] [ DO NOT EDIT BY HAND! ]*/ /* [ Created with wxMaxima version 0.8.6 ] */ /* [wxMaxima: title start ] Grafika v 3D [wxMaxima: title end ] */ /* [wxMaxima: section start ] Základní volby, ovlivňující vzhled 3D grafiky [wxMaxima: section end ] */ /* [wxMaxima: input start ] */ wxplot3d(cos(x*y),[x,-3,3], [y,-3,3]); /* [wxMaxima: input end ] */ /* [wxMaxima: input start ] */ wxplot3d(sqrt(1-x^2-y^2),[x,-1,1],[y,-1,1]); /* [wxMaxima: input end ] */ /* [wxMaxima: input start ] */ f(x,y):=cos(x*y)$ /* [wxMaxima: input end ] */ /* [wxMaxima: input start ] */ plot3d(f(x,y), [x,-3,3], [y,-3,3], ['grid,49,49],[box,false],[legend,false],[plot_format, openmath]); /* [wxMaxima: input end ] */ /* [wxMaxima: input start ] */ load(draw)$ /* [wxMaxima: input end ] */ /* [wxMaxima: input start ] */ wxdraw3d(surface_hide=true, explicit(f(x,y),x,-3,3,y,-3,3)); /* [wxMaxima: input end ] */ /* [wxMaxima: input start ] */ wxdraw3d(surface_hide=true, enhanced3d=true, explicit(f(x,y),x,-3,3,y,-3,3)); /* [wxMaxima: input end ] */ /* [wxMaxima: input start ] */ wxdraw3d(surface_hide=true, enhanced3d=true, colorbox=false, explicit(f(x,y),x,-3,3,y,-3,3)); /* [wxMaxima: input end ] */ /* [wxMaxima: input start ] */ wxdraw3d (user_preamble = "set pm3d at s depthorder", color = green, explicit(f(x,y), x,-3,3,y,-3,3)) $ /* [wxMaxima: input end ] */ /* [wxMaxima: input start ] */ wxdraw3d(zrange=[0,20], xu_grid=25, yv_grid=25,explicit(1/(x^2+y^2), x,-1,1, y,-1,1)); /* [wxMaxima: input end ] */ /* [wxMaxima: input start ] */ f1(x,y):=(x^2*y)/(x^2+y^2); /* [wxMaxima: input end ] */ /* [wxMaxima: input start ] */ wxplot3d(f1(x,y), [x,-3,3], [y,-3,3]); /* [wxMaxima: input end ] */ /* [wxMaxima: section start ] Speciální obrázky v 3D [wxMaxima: section end ] */ /* [wxMaxima: comment start ] Křivka daná parametricky [wxMaxima: comment end ] */ /* [wxMaxima: input start ] */ wxdraw3d(nticks=60, line_width=3, color=blue, parametric(cos(5*u)^2,sin(7*u),u-2,u,0,2)) $ /* [wxMaxima: input end ] */ /* [wxMaxima: input start ] */ wxdraw3d(nticks=400, line_width=2, color=red, parametric(t*cos(2*%pi*t), t*sin(2*%pi*t), 2+t,t,0,10))$ /* [wxMaxima: input end ] */ /* [wxMaxima: input start ] */ wxdraw3d(nticks=400, line_width=2, color=red, parametric(t*cos(2*%pi*t), t*sin(2*%pi*t), 2+t,t,0,10), parametric(2+t, t*cos(2*%pi*t), t*sin(2*%pi*t),t,0,10), parametric(t*cos(2*%pi*t), 2+t, t*sin(2*%pi*t),t,0,10))$ /* [wxMaxima: input end ] */ /* [wxMaxima: comment start ] Plocha daná parametricky [wxMaxima: comment end ] */ /* [wxMaxima: input start ] */ wxdraw3d(xu_grid = 50, yv_grid = 15, surface_hide = true, parametric_surface(cos(a)*(3+b*cos(a/2)), sin(a)*(3+b*cos(a/2)), b*sin(a/2), a,-%pi,%pi,b,-1,1) )$ /* [wxMaxima: input end ] */ /* [wxMaxima: input start ] */ wxdraw3d(xu_grid = 15, yv_grid = 45, enhanced3d = true, surface_hide = true, parametric_surface(r*cos(phi), r*sin(phi), phi, r,0,1,phi,0,6*%pi) )$ /* [wxMaxima: input end ] */ /* [wxMaxima: input start ] */ wxdraw3d(surface_hide = true, color = "midnight-blue",proportional_axes=xyz, axis_3d = false, xtics = none, ytics = none, ztics = none, spherical(1,theta,0,2*%pi,phi,0,%pi))$ /* [wxMaxima: input end ] */ /* [wxMaxima: input start ] */ wxdraw3d(surface_hide = true,proportional_axes=xy, color = "midnight-blue", axis_3d = false, xtics = none, ytics = none, ztics = none, cylindrical(1/2,z,-2,2,theta,0,2*%pi))$ /* [wxMaxima: input end ] */ /* [wxMaxima: input start ] */ wxdraw3d(surface_hide = true, color = "blue",proportional_axes=xyz, axis_3d = false, xtics = none, ytics = none, ztics = none, spherical(1,theta,0,2*%pi,phi,0,%pi), color=red, cylindrical(1/2,z,-2,2,theta,0,2*%pi))$ /* [wxMaxima: input end ] */ /* [wxMaxima: input start ] */ wxdraw3d(color = blue, explicit(20*exp(-x^2-y^2)-10,x,-3,3,y,-3,3), yv_grid = 10, color = red, explicit(x+y,x,-5,5,y,-5,5), surface_hide = true); /* [wxMaxima: input end ] */ /* [wxMaxima: input start ] */ f(x,y):=x^2+y^2-4; /* [wxMaxima: input end ] */ /* [wxMaxima: input start ] */ wxdraw3d(surface_hide = true, xlabel = "x", ylabel = "y", zlabel = "z", color = coral, xu_grid = 20, yv_grid = 10, explicit(x^2+y^2-4,x,-1.2,1.2,y,-1.2,1.2), color = black, line_width = 2, nticks = 40, parametric(cos(t),sin(t),f(cos(t), sin(t)),t,0,2*%pi) ); /* [wxMaxima: input end ] */ /* [wxMaxima: input start ] */ wxdraw3d(surface_hide = true, xlabel = "x", ylabel = "y", zlabel = "z", color = coral, xu_grid = 20, yv_grid = 10, explicit(x^2+y^2-4,x,-1.2,1.2,y,-1.2,1.2), color = black, line_width = 3, nticks = 40, parametric(cos(t),sin(t),(f(cos(t), sin(t))+0.1),t,0,2*%pi) ); /* [wxMaxima: input end ] */ /* [wxMaxima: input start ] */ U:log(sqrt((x+1)^2+y^2)) + log(sqrt((x-1)^2+y^2)) + log(sqrt((y+1)^2+x^2)) + log(sqrt((y-1)^2+x^2))$ /* [wxMaxima: input end ] */ /* [wxMaxima: input start ] */ U; /* [wxMaxima: input end ] */ /* [wxMaxima: input start ] */ wxdraw3d(xu_grid=50, yv_grid=50, explicit(U,x,-3/2,3/2,y,-3/2,3/2), contour_levels = 30, contour = map, surface_hide = true) ; /* [wxMaxima: input end ] */ /* [wxMaxima: input start ] */ wxdraw3d(color = green, explicit(20*exp(-x^2-y^2)-10,x,0,2,y,-3,3), contour_levels = 15, contour = both, surface_hide = true) ; /* [wxMaxima: input end ] */ /* [wxMaxima: input start ] */ wxdraw3d( surface_hide = true, color = green, explicit(exp(-x^2-y^2),x,-2,2,y,-2,2), contour = surface, contour_levels = 3); /* [wxMaxima: input end ] */ /* [wxMaxima: input start ] */ wxdraw3d(enhanced3d = true, implicit(x^3 + y^3 + z^3 + 1 = (x + y +z+1)^3,x,-2,2,y,-2,2,z,-2,2), surface_hide = true)$ /* [wxMaxima: input end ] */ /* [wxMaxima: section start ] Animace [wxMaxima: section end ] */ /* [wxMaxima: input start ] */ for d:1 thru 2 step 0.1 do plot2d(sin(x*d),[x,-10,10]); /* [wxMaxima: input end ] */ /* [wxMaxima: input start ] */ with_slider( d,makelist(i,i,10,20)/10, [sin(x*d)],[x,-10,10],[y,-1,1]); /* [wxMaxima: input end ] */ /* [wxMaxima: input start ] */ for d:1 thru 2 step 0.1 do draw2d(explicit(sin(x*d),x,-10,10)); /* [wxMaxima: input end ] */ /* [wxMaxima: input start ] */ with_slider_draw( d,makelist(i,i,10,20)/10, explicit(sin(d*x),x,-10,10) ); /* [wxMaxima: input end ] */ /* [wxMaxima: input start ] */ for d:1 thru 2 step 0.1 do draw3d(enhanced3d = true,explicit(cos(x*d)*sin(y*d),x,-%pi,%pi,y,-%pi,%pi)); /* [wxMaxima: input end ] */ /* [wxMaxima: comment start ] Vytvoření animovaného gifu na Linuxu [wxMaxima: comment end ] */ /* [wxMaxima: comment start ] Vytvoří jednotlivé PNG soubory [wxMaxima: comment end ] */ /* [wxMaxima: input start ] */ for k:1 thru 10 do draw2d(terminal = png, file_name = concat("ga",add_zeroes(k)), pic_width = 300, pic_height = 300, explicit(x^(0.1*k),x,0,1)); /* [wxMaxima: input end ] */ /* [wxMaxima: comment start ] Pomocí systémové příkazu convert je pak spojíme dohromady a vytvoříme animovaný gif. [wxMaxima: comment end ] */ /* [wxMaxima: input start ] */ system("convert -delay 10 ga*.png gifanim.gif")$ /* [wxMaxima: input end ] */ /* [wxMaxima: comment start ] [wxMaxima: comment end ] */ /* [wxMaxima: section start ] Geometrické obrazce [wxMaxima: section end ] */ /* [wxMaxima: input start ] */ wxdraw2d(fill_color = "sea-green", color = aquamarine, line_width = 6, polygon([[1,1],[3,0],[4,5],[0,3]]), transparent = true, line_type = dots, color = "dark-yellow", polygon([4,5,7],[6,4,2]), line_type = solid, transparent = false, fill_color = violet, rectangle([-2,-2],[8,-1]), /* protilehle vrcholy */ transparent = true, color = "dark-goldenrod", line_width = 1, rectangle([9,4],[2,-1.5]), transparent = false, fill_color = grey80, line_width = 2, ellipse(0,6,3,2,270,-270), transparent = true, color = "NaVy", line_width = 3, ellipse(7,6,2,3,30,-90), xrange = [-3,10], yrange = [-3,9] )$ /* [wxMaxima: input end ] */ /* [wxMaxima: comment start ] [wxMaxima: comment end ] */ /* Maxima can't load/batch files which end with a comment! */ "Created with wxMaxima"$