changecoords2d:= proc(p,coord::{name,function,identical(coords)={name,function}}) options `Maple Advisor Database 1.01 for Maple 6`, `Copyright (c) 1998 by Robert B. Israel. All rights reserved`; local q, F,cname, revit,s; if type(coord,`=`) then cname:= op(2,coord) else cname:= coord fi; if type(cname,specfunc(anything,'reverse')) then revit:= true; cname:= op(cname); else revit:= false; fi; if type(cname,function) then # parametrized: system(parameters) s:= zip(`=`, [_a,_b,_c],[op(cname)]); cname:= op(0,cname) fi; # list of coordinate expressions in _x, _y q:= readlib(`plot3d/coordSystems`)[cname]; if not type(q,list) or nops(q) <> 2 then ERROR(coord,` is not a known two-dimensional coordinate system`) fi; # give any parameters their values if s <> 's' then q:= subs(s,q) fi; if has(q,{_a,_b,_c}) then q:= subs(_a=1,_b=1/2,_c=1/3, q) fi; # make function to transform plot structures, and apply to p if revit then F:= plottools[transform](unapply(evalf(q),(_y,_x))); else F:= plottools[transform](unapply(evalf(q),(_x,_y))); fi; if hastype(p,rtable) then F(cvthfplot(p)) else F(p) fi end; cvthfplot:= proc(expr) # use to convert plots containing hfarrays options `Maple Advisor Database 1.01 for Maple 6`, `Copyright (c) 1998 by Robert B. Israel. All rights reserved`; if type(expr,rtable) then if rtable_num_dims(expr) >= 2 then convert(expr,listlist) else convert(expr,list) fi elif type(expr,function) and op(0,expr)=COLOR and type(op(2,expr),rtable) then COLOR(op(1,expr),op(convert(op(2,expr),list))) elif hastype(expr,rtable) then map(cvthfplot,expr) else expr fi end;