Renames Xmaxima function apply to mxapply, to avoid conflicts with the
[maxima.git] / demo / plots.mac
blob9b5525be6a0576791fafaeda5a4902823f321e0e
1 /* a few sample plots */
3   
4 numer:true;  
5   
6 /* some nice figures.   fig1.ps from fig1.mac
7   shows the units of a quadratic number field
8     as lying on the yx= +- 1
9   */    
10   
11 viewps("fig1.ps");
12   
13 /* REal part of z ^ 1/3 */
15 viewps("maxout-3.ps");  
16   
17 plot2d(sin(x),[-%pi,%pi]);  
18 plot2d(3*sin(x),[-%pi,%pi]);  
19   
20 block([ps_scale:[40,20],ps_translate:[5,15]],
21   psaxes(4,10),
22   plot2d(3*x^2*sin(x),[-%pi,%pi]));  
23   
24 viewps("fig21.ps");  
25   
26 /* REal part of z ^ 1/3 */
27   
28 block([ps_scale:[200,200],
29   ps_translate:[1.5,1.5],
30   colour_z:true,transform_xy:polar_to_xy],
31   closeps(),
32   plot3d(r^.3333*cos(th/3),[1,1,1.4],[0,1,0,6*%pi],[12,81]),
33   closeps(),viewps());
34     
35     
36     
37 /* REal part of z ^ 1/6 */  
38 block([ps_scale:[200,200],
39   ps_translate:[1.5,1.5],
40   colour_z:true,transform_xy:polar_to_xy],
41   plot3d(r^(1/6.0)*cos(th/6),[1,1,1.4],[0,1,0,2*6*%pi],[12,121]),
42   closeps(),viewps()
43   );
44   
45     
48 display2d:false;
49 set_up_dot_simplifications([z.z+y.y+y.x+x.y,-a*z.z+y.x+x.y+x.x,a*z.y,z.x-a*y.z-x.z],4);
50 centrals:fast_central_elements([x,y,z],3);
51 centrals4:  fast_central_elements([x,y,z],4);
52 set_up_dot_simplifications(append(centrals,centrals4,[z.z+y.y+y.x+x.y,-a*z.z+y.x+x.y+x.x,a*z.y,z.x-a*y.z-x.z]),8);
53 monomial_dimensions(8);
54