rotyplot:=proc() local a, b, c, d, f, i, xbound, rotaxis, f1, opts, opt_seq, p1, profile, tloc; if nargs < 3 then ERROR(`Procedura ma alespon tri parametry`) fi; f:=args[1]; xbound:=args[2]; rotaxis:=lhs(args[3])=evalf(rhs(args[3])); a:=op(1, rhs(xbound)); b:=op(2, rhs(xbound)); ### WARNING: semantics of type `string` have changed if not type (rhs(xbound), range) then ERROR(`Interval pro x je zadan nespravne`) fi; ### WARNING: semantics of type `string` have changed if not type (rhs(rotaxis), numeric) then ERROR(`Vyraz pro osu rotace je zadan nespravne`) fi; if not (lhs(xbound) = 'x') or not (lhs(rotaxis) = 'x') then ERROR(`Nazev prvni promenne musi byt x`) fi; if not type (evalf(a), numeric) or not type(evalf(b), numeric) then ERROR(`Krajni body intervalu pro x musi byt cisla` ) fi; c:=rhs(rotaxis); d:=lhs(xbound); opts:=style=PATCH, scaling=CONSTRAINED, axes=BOXED, grid=[25,25],labels=[` `,'x','y']; if not type (f, procedure) or not type(f, list) then f1:=unapply(f,d); fi; if type(f,procedure) then f1:=f; fi; if not type(f, list) then profile:=[(d-c)*sin(tloc),(d-c)*cos(tloc)+c,f1(d)]; fi; if type(f,list) then f1:=unapply(f,d); profile:=[(f1(d)[1]-c)*sin(tloc),(f1(d)[1]-c)*cos(tloc)+c,f1(d)[2]]; fi; if nargs = 3 then p1:=plot3d(profile,d=a..b,tloc=0..2*Pi,opts); fi; if nargs > 3 then opt_seq:=opts,seq(args[i],`i`=4..nargs); p1:=plot3d(profile,d=a..b,tloc=0..2*Pi),opt_seq; fi; plots[display3d](p1); end: #A y-axis rotation plotter. Same input as xrotplot, except that the axis of #rotation is given in the form y=c. rotxplot:=proc() local a, b, c, d, f1, f, i, xbound, rotaxis, opts, opt_seq, p1, profile, tloc; if nargs < 3 then ERROR(`Procedura ma alespon tri parametry`) fi; f:=args[1]; xbound:=args[2]; rotaxis:=lhs(args[3])=evalf(rhs(args[3])); a:=op(1, rhs(xbound)); b:=op(2, rhs(xbound)); ### WARNING: semantics of type `string` have changed if not type (rhs(xbound), range) then ERROR(`Interval pro x je zadan nespravne`) fi; ## WARNING: semantics of type `string` have changed if not type (rhs(rotaxis), numeric) then ERROR(`Vyraz pro osu rotace je zadan nespravne`) fi; if not (lhs(xbound) = 'x') or not (lhs(rotaxis) = 'y') then ERROR(`Nazev druhe promenne musi byt x`) fi; if not type (evalf(a), numeric) or not type(evalf(b), numeric) then ERROR(`Krajni body intervalu pro x musi byt cisla` ) fi; c:=rhs(rotaxis); d:=lhs(xbound); opts:=style=PATCH, scaling=CONSTRAINED, axes=BOXED, grid=[25,25],labels=[` `,'x','y']; if not type (f, procedure) or not type (f, list) then f1:=unapply(f,d); fi; if type (f, procedure) then f1:=f; fi; if not type(f,list) then profile:=[(f1(d)-c)*sin(tloc),d,(f1(d)-c)*cos(tloc)+c]; fi; if type(f,list) then f1:=unapply(f,d); profile:=[(f1(d)[2]-c)*sin(tloc),f1(d)[1],(f1(d)[2]-c)*cos(tloc)+c]; fi; if nargs = 3 then p1:=plot3d(profile,d=a..b,tloc=0..2*Pi,opts); fi; if nargs > 3 then opt_seq:=opts,seq(args[i],`i`=4..nargs); p1:=plot3d(profile,d=a..b,tloc=0..2*Pi),opt_seq; fi; plots[display3d](p1); end: