Search:

Return to previous page

Contents of file 'poincare/example-a.mp':



    1   % This Filename:  example-a.mp   [MetaPost source]
    2   % Creation time:  Thu Jan 23 20:19:25 2014
    3   %
    4   % Copyright (C) 1997-2005, Fredrik Jonsson <fj@optics.kth.se>
    5   %
    6   % Input Filename [Stokes parameters]:  example-a.dat
    7   % This MetaPost source code was automatically generated by poincare
    8   % Full set of command line options that generated this code:
    9   %     --verbose --normalize --inputfile example-a.dat --outputfile example-a.mp
   10   %     --axislengths 0.3 1.7 0.3 2.4 0.3
   11   %     1.5 --axislabels s_1(t) bot s_2(t) bot
   12   %     s_3(t) rt --rotatephi 15.3 --rotatepsi -60.0
   13   %     --shading 0.75 0.99 --rhodivisor 50 --phidivisor
   14   %     80 --scalefactor 20.0 --paththickness 0.8 --arrowthickness
   15   %     0.4
   16   %
   17   % Description:  Map of Stokes parameters, visualized as trajectories
   18   %               onto the Poincare sphere. This file contains MetaPost
   19   %               source code, to be compiled with John Hobby's MetaPost
   20   %               compiler or used with anything that understands MetaPost
   21   %               source code.
   22   %
   23   % If you want to create PostScript output, or include the resulting
   24   % output in a TeX document, this example illustrates the procedure,
   25   % assuming 'poincaremap.mp' to be the name of the file containing the
   26   % MetaPost code to be visualized: (commands run on command-line)
   27   %
   28   %       mp poincaremap.mp;
   29   %       echo "\input epsf\centerline{\epsfbox{poincaremap.1}}\bye" > tmp.tex;
   30   %       tex tmp.tex;
   31   %       dvips tmp.dvi -o poincaremap.ps;
   32   %
   33   % Here, the first command compiles the MetaPost source code, and leaves
   34   % an Encapsulated PostScript file named 'poincaremap.1', containing TeX
   35   % control codes for characters, etc. This file does not contain any
   36   % definitions for characters or TeX-specific items, and it cannot be
   37   % viewed or printed simply as is stands; it must rather be included into
   38   % TeX code in order to provide something useful.
   39   %     The second command creates a temporary minimal TeX-file 'tmp.tex',
   40   % that only includes the previously generated Encapsulated PostScript
   41   % code.
   42   %     The third command compiles the TeX-code into device-independent,
   43   % or DVI, output, stored in the file 'tmp.dvi'.
   44   %     Finally, the last command converts the DVI output into a free-
   45   % standing PostScript file 'poincaremap.ps', to be printed or viewed
   46   % with some PostScript viewer, such as GhostView.
   47   %
   48   scalefactor := 20.000000 mm;
   49   rot_psi := -60.000000;  % Rotation angle round z-axis (first rotation)
   50   rot_phi := 15.300000;  % Rotation angle round y-axis (second rotation)
   51   alpha := -24.562369;    % == arctan(sin(rot_phi)*tan(rot_psi))
   52   beta  := -8.662244;    % == arctan(sin(rot_phi)/tan(rot_psi))
   53   
   54   %
   55   % Parameters specifying the location of the light source; for Phong
   56   % shading of the sphere.
   57   %
   58   %    phi_source:  Angle (in deg.) to light source counterclockwise
   59   %                 'from three o'clock', viewed from the observer.
   60   %
   61   %  theta_source:  Angle (in deg.) between light source and observer,
   62   %                 seen from the centre of the sphere.
   63   %
   64   % Parameters specifying the shading 'intensity' in terms of maximum
   65   % (for the highlighs) and minimum (for the deep shadowed regions)
   66   % values for the Phong shading.  '0.0' <=> 'black'; '1.0' <=> 'white'
   67   %
   68   %   upper_value:  Maximum value of whiteness.
   69   %   lower_value:  Minimum value of whiteness.
   70   %
   71   phi_source := 30.000000;
   72   theta_source := 30.000000;
   73   upper_value := 0.990000;
   74   lower_value := 0.750000;
   75   radius := scalefactor;
   76   delta_rho := radius/50.000000;
   77   delta_phi := 360.0/80.000000;
   78   beginfig(1);
   79     path p;
   80     path equator;
   81     transform T;
   82     c1:=lower_value;
   83     c2:=upper_value-lower_value;
   84     nx_source := sind(theta_source)*cosd(phi_source);
   85     ny_source := sind(theta_source)*sind(phi_source);
   86     nz_source := cosd(theta_source);
   87     phistop := 360.0;
   88     rhostop := radius - delta_rho/2.0;
   89   %
   90   % Draw the shaded Poincare sphere projected on 2D screen coordinates
   91   %
   92     for rho=0.0cm step delta_rho until rhostop:
   93       for phi=0.0 step delta_phi until phistop:
   94         rhomid := rho + delta_rho/2.0;
   95         phimid := phi + delta_phi/2.0;
   96         x1 := rho*cosd(phi);
   97         y1 := rho*sind(phi);
   98         x2 := (rho+delta_rho)*cosd(phi);
   99         y2 := (rho+delta_rho)*sind(phi);
  100         x3 := (rho+delta_rho)*cosd(phi+delta_phi);
  101         y3 := (rho+delta_rho)*sind(phi+delta_phi);
  102         x4 := rho*cosd(phi+delta_phi);
  103         y4 := rho*sind(phi+delta_phi);
  104         p:=makepath makepen ((x1,y1)--(x2,y2)--(x3,y3)--(x4,y4)--(x1,y1));
  105         quot := (rhomid/radius);
  106         nx_object := quot*cosd(phimid);
  107         ny_object := quot*sind(phimid);
  108         nz_object := sqrt(1-quot*quot);
  109         prod:=nx_object*nx_source+ny_object*ny_source
  110               +nz_object*nz_source;
  111         if prod < 0.0:
  112            value := c1;
  113         else:
  114            value := c1 + c2*prod*prod;
  115         fi
  116         fill p withcolor value[black,white];
  117       endfor
  118     endfor
  119   
  120   %
  121   % Draw the 'equators' of the Poincare sphere
  122   %
  123      equator := halfcircle scaled (2.0*radius);
  124      eqcolval := .45;    % '0.0' <=> 'white';  '1.0' <=> 'black'
  125   
  126      pickup pencircle scaled 0.600000 pt;
  127   %
  128   % Draw equator $S_3=0$...
  129   %
  130      T := identity yscaled sind(rot_phi) rotated 180.0;
  131      draw equator transformed T withcolor eqcolval [white,black];
  132   
  133   %
  134   % ... then equator $S_2=0$...
  135   %
  136      T := identity yscaled (cosd(rot_phi)*sind(rot_psi))
  137                    rotated (270.0 + alpha);
  138      draw equator transformed T withcolor eqcolval [white,black];
  139   
  140   %
  141   % ... and finally equator $S_1=0$.
  142   %
  143      T := identity yscaled (cosd(rot_phi)*cosd(rot_psi))
  144                    rotated (270.0 - beta);
  145      draw equator transformed T withcolor eqcolval [white,black];
  146   
  147     oldahangle:=ahangle;
  148     ahangle:=30.000000;
  149     pickup pencircle scaled 0.800000 pt;
  150      pickup pencircle scaled 0.800000 pt;
  151      p := makepath makepen (-0.0407,0.9992)--(-0.0724,0.9974);
  152      draw p scaled radius withcolor 0.650000 [black,white];
  153      pickup pencircle scaled 0.800000 pt;
  154      p := makepath makepen (0.4936,0.8695)--(0.4669,0.8810)
  155       --(0.4335,0.8916)--(0.3935,0.9012)--(0.3475,0.9096)
  156       --(0.2958,0.9166)--(0.2391,0.9220)--(0.1781,0.9257)
  157       --(0.1134,0.9274)--(0.0460,0.9272)--(-0.0232,0.9248)
  158       --(-0.0935,0.9203)--(-0.1638,0.9136)--(-0.2332,0.9047)
  159       --(-0.3007,0.8937)--(-0.3654,0.8805)--(-0.4264,0.8653)
  160       --(-0.4827,0.8481)--(-0.5334,0.8292)--(-0.5779,0.8087)
  161       --(-0.6155,0.7867);
  162      draw p scaled radius withcolor 0.650000 [black,white];
  163      pickup pencircle scaled 0.800000 pt;
  164      p := makepath makepen (0.7983,0.6012)--(0.7748,0.6195)
  165       --(0.7409,0.6372)--(0.6968,0.6537)--(0.6432,0.6687)
  166       --(0.5806,0.6821)--(0.5096,0.6936)--(0.4315,0.7028)
  167       --(0.3468,0.7095)--(0.2569,0.7137)--(0.1627,0.7150)
  168       --(0.0657,0.7135)--(-0.0330,0.7089)--(-0.1321,0.7014)
  169       --(-0.2303,0.6908)--(-0.3262,0.6773)--(-0.4185,0.6608)
  170       --(-0.5061,0.6415)--(-0.5877,0.6196)--(-0.6621,0.5952)
  171       --(-0.7284,0.5686)--(-0.7856,0.5400)--(-0.8328,0.5098)
  172       --(-0.8694,0.4782)--(-0.8948,0.4455);
  173      draw p scaled radius withcolor 0.650000 [black,white];
  174      pickup pencircle scaled 0.800000 pt;
  175      p := makepath makepen (0.9682,0.2435)--(0.9496,0.2658)
  176       --(0.9186,0.2874)--(0.8754,0.3079)--(0.8206,0.3269)
  177       --(0.7549,0.3441)--(0.6791,0.3593)--(0.5942,0.3719)
  178       --(0.5014,0.3819)--(0.4018,0.3889)--(0.2966,0.3930)
  179       --(0.1873,0.3937)--(0.0754,0.3911)--(-0.0378,0.3852)
  180       --(-0.1506,0.3757)--(-0.2616,0.3629)--(-0.3695,0.3467)
  181       --(-0.4727,0.3273)--(-0.5698,0.3049)--(-0.6596,0.2796)
  182       --(-0.7409,0.2517)--(-0.8125,0.2214)--(-0.8736,0.1892)
  183       --(-0.9233,0.1553)--(-0.9609,0.1201)--(-0.9860,0.0838)
  184       --(-0.9982,0.0470);
  185      draw p scaled radius withcolor 0.650000 [black,white];
  186      pickup pencircle scaled 0.800000 pt;
  187      p := makepath makepen (0.9865,-0.1552)--(0.9778,-0.1324)
  188       --(0.9564,-0.1101)--(0.9225,-0.0886)--(0.8766,-0.0683)
  189       --(0.8194,-0.0497)--(0.7517,-0.0329)--(0.6743,-0.0184)
  190       --(0.5884,-0.0064)--(0.4950,0.0029)--(0.3956,0.0093)
  191       --(0.2912,0.0124)--(0.1833,0.0125)--(0.0736,0.0093)
  192       --(-0.0367,0.0027)--(-0.1462,-0.0072)--(-0.2533,-0.0204)
  193       --(-0.3566,-0.0367)--(-0.4549,-0.0561)--(-0.5468,-0.0782)
  194       --(-0.6311,-0.1030)--(-0.7068,-0.1301)--(-0.7729,-0.1594)
  195       --(-0.8286,-0.1904)--(-0.8732,-0.2228)--(-0.9062,-0.2564)
  196       --(-0.9271,-0.2907)--(-0.9359,-0.3253)--(-0.9324,-0.3599);
  197      draw p scaled radius withcolor 0.650000 [black,white];
  198      pickup pencircle scaled 0.800000 pt;
  199      p := makepath makepen (0.8480,-0.5275)--(0.8488,-0.5077)
  200       --(0.8386,-0.4881)--(0.8176,-0.4691)--(0.7860,-0.4510)
  201       --(0.7444,-0.4341)--(0.6935,-0.4186)--(0.6340,-0.4049)
  202       --(0.5668,-0.3932)--(0.4929,-0.3837)--(0.4133,-0.3766)
  203       --(0.3291,-0.3720)--(0.2414,-0.3699)--(0.1515,-0.3706)
  204       --(0.0605,-0.3741)--(-0.0301,-0.3801)--(-0.1195,-0.3890)
  205       --(-0.2063,-0.4005)--(-0.2894,-0.4145)--(-0.3678,-0.4308)
  206       --(-0.4405,-0.4493)--(-0.5064,-0.4699)--(-0.5651,-0.4921)
  207       --(-0.6156,-0.5160)--(-0.6575,-0.5410)--(-0.6902,-0.5671)
  208       --(-0.7135,-0.5938)--(-0.7271,-0.6209)--(-0.7311,-0.6481)
  209       --(-0.7254,-0.6750)--(-0.7103,-0.7015);
  210      draw p scaled radius withcolor 0.650000 [black,white];
  211      pickup pencircle scaled 0.800000 pt;
  212      p := makepath makepen (0.5663,-0.8239)--(0.5794,-0.8103)
  213       --(0.5846,-0.7966)--(0.5820,-0.7829)--(0.5718,-0.7696)
  214       --(0.5543,-0.7568)--(0.5298,-0.7448)--(0.4988,-0.7338)
  215       --(0.4621,-0.7239)--(0.4198,-0.7154)--(0.3731,-0.7082)
  216       --(0.3225,-0.7026)--(0.2687,-0.6987)--(0.2125,-0.6965)
  217       --(0.1549,-0.6960)--(0.0966,-0.6973)--(0.0383,-0.7004)
  218       --(-0.0189,-0.7052)--(-0.0746,-0.7116)--(-0.1279,-0.7196)
  219       --(-0.1781,-0.7292)--(-0.2247,-0.7400)--(-0.2671,-0.7521)
  220       --(-0.3048,-0.7652)--(-0.3374,-0.7792)--(-0.3646,-0.7940)
  221       --(-0.3862,-0.8093)--(-0.4021,-0.8250)--(-0.4121,-0.8408)
  222       --(-0.4164,-0.8565)--(-0.4150,-0.8722)--(-0.4080,-0.8874)
  223       --(-0.3958,-0.9021)--(-0.3787,-0.9161)--(-0.3571,-0.9294)
  224       --(-0.3314,-0.9416)--(-0.3021,-0.9529)--(-0.2698,-0.9629);
  225      draw p scaled radius withcolor 0.650000 [black,white];
  226      pickup pencircle scaled 0.800000 pt;
  227      p := makepath makepen (0.1513,-0.9884)--(0.1742,-0.9839)
  228       --(0.1934,-0.9789)--(0.2090,-0.9735)--(0.2210,-0.9678)
  229       --(0.2292,-0.9619)--(0.2338,-0.9559)--(0.2346,-0.9501)
  230       --(0.2322,-0.9443)--(0.2265,-0.9389)--(0.2179,-0.9339)
  231       --(0.2066,-0.9293)--(0.1930,-0.9252)--(0.1774,-0.9218)
  232       --(0.1602,-0.9190)--(0.1418,-0.9168)--(0.1226,-0.9153)
  233       --(0.1028,-0.9145)--(0.0831,-0.9144)--(0.0637,-0.9150)
  234       --(0.0448,-0.9161)--(0.0269,-0.9178)--(0.0103,-0.9201)
  235       --(-0.0049,-0.9228)--(-0.0184,-0.9259)--(-0.0300,-0.9293)
  236       --(-0.0397,-0.9328)--(-0.0475,-0.9366)--(-0.0530,-0.9404)
  237       --(-0.0567,-0.9441)--(-0.0583,-0.9477)--(-0.0581,-0.9512)
  238       --(-0.0563,-0.9544)--(-0.0528,-0.9573)--(-0.0480,-0.9598)
  239       --(-0.0423,-0.9619)--(-0.0356,-0.9635)--(-0.0285,-0.9647)
  240       --(-0.0211,-0.9654)--(-0.0136,-0.9656)--(-0.0065,-0.9653)
  241       --(-0.0000,-0.9646);
  242      draw p scaled radius withcolor 0.650000 [black,white];
  243      pickup pencircle scaled 0.400000 pt;
  244     ahangle:=oldahangle;
  245     oldahangle:=ahangle;
  246     ahangle:=30.000000;
  247     pickup pencircle scaled 0.800000 pt;
  248      pickup pencircle scaled 0.800000 pt;
  249      p := makepath makepen (0.0000,0.9646)--(-0.0057,0.9634)
  250       --(-0.0104,0.9619)--(-0.0139,0.9600)--(-0.0159,0.9579)
  251       --(-0.0163,0.9556)--(-0.0152,0.9531)--(-0.0122,0.9506)
  252       --(-0.0076,0.9481)--(-0.0013,0.9456)--(0.0068,0.9434)
  253       --(0.0163,0.9413)--(0.0272,0.9396)--(0.0393,0.9383)
  254       --(0.0523,0.9373)--(0.0661,0.9369)--(0.0802,0.9369)
  255       --(0.0944,0.9375)--(0.1085,0.9386)--(0.1219,0.9403)
  256       --(0.1345,0.9424)--(0.1458,0.9452)--(0.1556,0.9484)
  257       --(0.1635,0.9520)--(0.1692,0.9560)--(0.1726,0.9603)
  258       --(0.1733,0.9648)--(0.1711,0.9694)--(0.1661,0.9741)
  259       --(0.1579,0.9787)--(0.1467,0.9831)--(0.1324,0.9872)
  260       --(0.1151,0.9910)--(0.0950,0.9942)--(0.0721,0.9968)
  261       --(0.0468,0.9987)--(0.0193,0.9998)--(-0.0099,0.9999)
  262       --(-0.0407,0.9992);
  263      draw p scaled radius withcolor black;
  264      pickup pencircle scaled 0.800000 pt;
  265      p := makepath makepen (-0.0724,0.9974)--(-0.1047,0.9945)
  266       --(-0.1371,0.9905)--(-0.1691,0.9854)--(-0.2001,0.9792)
  267       --(-0.2296,0.9719)--(-0.2573,0.9635)--(-0.2824,0.9541)
  268       --(-0.3046,0.9438)--(-0.3233,0.9326)--(-0.3383,0.9207)
  269       --(-0.3491,0.9081)--(-0.3553,0.8950)--(-0.3569,0.8816)
  270       --(-0.3535,0.8679)--(-0.3450,0.8543)--(-0.3314,0.8406)
  271       --(-0.3127,0.8273)--(-0.2890,0.8144)--(-0.2606,0.8021)
  272       --(-0.2276,0.7906)--(-0.1904,0.7799)--(-0.1493,0.7704)
  273       --(-0.1049,0.7620)--(-0.0578,0.7549)--(-0.0084,0.7492)
  274       --(0.0426,0.7449)--(0.0944,0.7422)--(0.1464,0.7411)
  275       --(0.1979,0.7415)--(0.2481,0.7436)--(0.2963,0.7472)
  276       --(0.3417,0.7522)--(0.3836,0.7587)--(0.4215,0.7665)
  277       --(0.4545,0.7755)--(0.4822,0.7855)--(0.5041,0.7964)
  278       --(0.5196,0.8080)--(0.5286,0.8201)--(0.5306,0.8325)
  279       --(0.5253,0.8451)--(0.5130,0.8575)--(0.4936,0.8695);
  280      draw p scaled radius withcolor black;
  281      pickup pencircle scaled 0.800000 pt;
  282      p := makepath makepen (-0.6155,0.7867)--(-0.6455,0.7635)
  283       --(-0.6674,0.7393)--(-0.6806,0.7145)--(-0.6851,0.6892)
  284       --(-0.6805,0.6636)--(-0.6668,0.6382)--(-0.6441,0.6131)
  285       --(-0.6124,0.5888)--(-0.5721,0.5652)--(-0.5237,0.5429)
  286       --(-0.4676,0.5221)--(-0.4046,0.5029)--(-0.3354,0.4856)
  287       --(-0.2607,0.4704)--(-0.1817,0.4574)--(-0.0991,0.4468)
  288       --(-0.0142,0.4387)--(0.0719,0.4331)--(0.1581,0.4301)
  289       --(0.2433,0.4298)--(0.3263,0.4319)--(0.4061,0.4367)
  290       --(0.4813,0.4438)--(0.5511,0.4530)--(0.6144,0.4644)
  291       --(0.6703,0.4777)--(0.7178,0.4926)--(0.7565,0.5090)
  292       --(0.7856,0.5263)--(0.8046,0.5447)--(0.8132,0.5634)
  293       --(0.8111,0.5824)--(0.7983,0.6012);
  294      draw p scaled radius withcolor black;
  295      pickup pencircle scaled 0.800000 pt;
  296      p := makepath makepen (-0.8948,0.4455)--(-0.9086,0.4121)
  297       --(-0.9105,0.3784)--(-0.9005,0.3447)--(-0.8786,0.3113)
  298       --(-0.8450,0.2788)--(-0.8001,0.2472)--(-0.7444,0.2172)
  299       --(-0.6786,0.1889)--(-0.6035,0.1626)--(-0.5201,0.1386)
  300       --(-0.4293,0.1173)--(-0.3324,0.0988)--(-0.2308,0.0831)
  301       --(-0.1255,0.0707)--(-0.0180,0.0614)--(0.0902,0.0554)
  302       --(0.1977,0.0526)--(0.3032,0.0530)--(0.4051,0.0566)
  303       --(0.5022,0.0633)--(0.5932,0.0727)--(0.6766,0.0849)
  304       --(0.7516,0.0994)--(0.8170,0.1162)--(0.8719,0.1348)
  305       --(0.9156,0.1549)--(0.9475,0.1763)--(0.9671,0.1983)
  306       --(0.9740,0.2209)--(0.9682,0.2435);
  307      draw p scaled radius withcolor black;
  308      pickup pencircle scaled 0.800000 pt;
  309      p := makepath makepen (-0.9982,0.0470)--(-0.9974,0.0100)
  310       --(-0.9835,-0.0268)--(-0.9567,-0.0629)--(-0.9174,-0.0982)
  311       --(-0.8660,-0.1319)--(-0.8034,-0.1640)--(-0.7302,-0.1940)
  312       --(-0.6475,-0.2217)--(-0.5564,-0.2467)--(-0.4579,-0.2688)
  313       --(-0.3536,-0.2879)--(-0.2447,-0.3037)--(-0.1327,-0.3162)
  314       --(-0.0190,-0.3252)--(0.0948,-0.3308)--(0.2072,-0.3330)
  315       --(0.3169,-0.3318)--(0.4222,-0.3274)--(0.5219,-0.3198)
  316       --(0.6146,-0.3093)--(0.6992,-0.2962)--(0.7744,-0.2807)
  317       --(0.8394,-0.2630)--(0.8933,-0.2435)--(0.9354,-0.2227)
  318       --(0.9652,-0.2008)--(0.9823,-0.1781)--(0.9865,-0.1552);
  319      draw p scaled radius withcolor black;
  320      pickup pencircle scaled 0.800000 pt;
  321      p := makepath makepen (-0.9324,-0.3599)--(-0.9167,-0.3942)
  322       --(-0.8891,-0.4277)--(-0.8500,-0.4601)--(-0.8001,-0.4910)
  323       --(-0.7400,-0.5202)--(-0.6706,-0.5473)--(-0.5929,-0.5722)
  324       --(-0.5079,-0.5945)--(-0.4168,-0.6140)--(-0.3209,-0.6307)
  325       --(-0.2214,-0.6444)--(-0.1197,-0.6549)--(-0.0171,-0.6623)
  326       --(0.0850,-0.6666)--(0.1853,-0.6679)--(0.2824,-0.6661)
  327       --(0.3750,-0.6615)--(0.4622,-0.6542)--(0.5426,-0.6443)
  328       --(0.6152,-0.6322)--(0.6793,-0.6180)--(0.7340,-0.6021)
  329       --(0.7786,-0.5848)--(0.8127,-0.5664)--(0.8359,-0.5472)
  330       --(0.8480,-0.5275);
  331      draw p scaled radius withcolor black;
  332      pickup pencircle scaled 0.800000 pt;
  333      p := makepath makepen (-0.7103,-0.7015)--(-0.6861,-0.7273)
  334       --(-0.6533,-0.7519)--(-0.6124,-0.7753)--(-0.5641,-0.7972)
  335       --(-0.5089,-0.8174)--(-0.4480,-0.8356)--(-0.3821,-0.8518)
  336       --(-0.3122,-0.8658)--(-0.2394,-0.8775)--(-0.1644,-0.8869)
  337       --(-0.0884,-0.8939)--(-0.0125,-0.8986)--(0.0623,-0.9010)
  338       --(0.1350,-0.9011)--(0.2048,-0.8990)--(0.2708,-0.8949)
  339       --(0.3321,-0.8889)--(0.3879,-0.8812)--(0.4377,-0.8719)
  340       --(0.4808,-0.8613)--(0.5169,-0.8496)--(0.5455,-0.8371)
  341       --(0.5663,-0.8239);
  342      draw p scaled radius withcolor black;
  343      pickup pencircle scaled 0.800000 pt;
  344      p := makepath makepen (-0.2698,-0.9629)--(-0.2350,-0.9718)
  345       --(-0.1982,-0.9794)--(-0.1602,-0.9857)--(-0.1213,-0.9907)
  346       --(-0.0823,-0.9944)--(-0.0438,-0.9969)--(-0.0062,-0.9981)
  347       --(0.0300,-0.9981)--(0.0642,-0.9971)--(0.0961,-0.9951)
  348       --(0.1252,-0.9921)--(0.1513,-0.9884);
  349      draw p scaled radius withcolor black;
  350      pickup pencircle scaled 0.400000 pt;
  351     ahangle:=oldahangle;
  352   %
  353   % Draw the $S_1$-, $S_2$- and $S_3$-axis of the Poincare sphere.
  354   % First of all, calculate the transformations of the intersections
  355   % for the unity sphere.
  356   %
  357   % Used variables:
  358   %
  359   %    behind_distance : Specifies the relative distance of the coordi-
  360   %                      axes to be plotted behind origo (in negative di-
  361   %                      rection of respective axis.
  362   %
  363   %   outside_distance_s1 : The relative distance from origo to the point
  364   %                         of the arrow head of the coordinate axis S1.
  365   %                         If this is set to 1.0, the arrow head will
  366   %                         point directly at the Poincare sphere.
  367   %
  368   %   outside_distance_s2 : Same as above, except that this one controls
  369   %                         the S2 coordinate axis instead.
  370   %
  371   %   outside_distance_s3 : Same as above, except that this one controls
  372   %                         the S3 coordinate axis instead.
  373   %
  374   %    insidecolval :    Specifies the shade of gray to use for the parts
  375   %                      of the coordinate axes that are inside the Poin-
  376   %                      care sphere. Values must be between 0 and 1,
  377   %                      where:  '0.0' <=> 'white';  '1.0' <=> 'black'
  378   %
  379      behind_distance_s1  := -0.300000;
  380      behind_distance_s2  := -0.300000;
  381      behind_distance_s3  := -0.300000;
  382      outside_distance_s1 :=  1.700000;
  383      outside_distance_s2 :=  2.400000;
  384      outside_distance_s3 :=  1.500000;
  385      insidecolval := .85;    % '0.0' <=> 'white';  '1.0' <=> 'black'
  386   
  387      pickup pencircle scaled 0.600000 pt;
  388   %
  389   % Start with drawing the x-axis...
  390   %
  391      x_bis_start :=  radius*behind_distance_s1*cosd(rot_psi)*cosd(rot_phi);
  392      y_bis_start :=  radius*behind_distance_s1*sind(rot_psi);
  393      z_bis_start := -radius*behind_distance_s1*cosd(rot_psi)*sind(rot_phi);
  394      x_bis_intersect :=  radius*cosd(rot_psi)*cosd(rot_phi);
  395      y_bis_intersect :=  radius*sind(rot_psi);
  396      z_bis_intersect := -radius*cosd(rot_psi)*sind(rot_phi);
  397      p := makepath makepen (y_bis_intersect,z_bis_intersect)--
  398                (outside_distance_s1*y_bis_intersect,
  399                 outside_distance_s1*z_bis_intersect);
  400      drawarrow p;
  401      label.bot(btex $s_1(t)$ etex,
  402                (outside_distance_s1*y_bis_intersect,
  403                 outside_distance_s1*z_bis_intersect));
  404   
  405   %
  406   % ... then draw the y-axis ...
  407   %
  408      x_bis_start := -radius*behind_distance_s2*sind(rot_psi)*cosd(rot_phi);
  409      y_bis_start :=  radius*behind_distance_s2*cosd(rot_psi);
  410      z_bis_start :=  radius*behind_distance_s2*sind(rot_psi)*sind(rot_phi);
  411      x_bis_intersect := -radius*sind(rot_psi)*cosd(rot_phi);
  412      y_bis_intersect :=  radius*cosd(rot_psi);
  413      z_bis_intersect :=  radius*sind(rot_psi)*sind(rot_phi);
  414      p := makepath makepen (y_bis_intersect,z_bis_intersect)--
  415                (outside_distance_s2*y_bis_intersect,
  416                 outside_distance_s2*z_bis_intersect);
  417      drawarrow p;
  418      label.bot(btex $s_2(t)$ etex,
  419                (outside_distance_s2*y_bis_intersect,
  420                 outside_distance_s2*z_bis_intersect));
  421   
  422   %
  423   % ... then, finally, draw the z-axis.
  424   %
  425      x_bis_start := radius*behind_distance_s3*sind(rot_phi);
  426      y_bis_start := 0.0;
  427      z_bis_start := radius*behind_distance_s3*cosd(rot_phi);
  428      x_bis_intersect := radius*sind(rot_phi);
  429      y_bis_intersect := 0.0;
  430      z_bis_intersect := radius*cosd(rot_phi);
  431      p := makepath makepen (y_bis_intersect,z_bis_intersect)--
  432                (outside_distance_s3*y_bis_intersect,
  433                 outside_distance_s3*z_bis_intersect);
  434      drawarrow p;
  435      label.rt(btex $s_3(t)$ etex,
  436                (outside_distance_s3*y_bis_intersect,
  437                 outside_distance_s3*z_bis_intersect));
  438   
  439      endfig;
  440   end
  441   

Return to previous page

Generated by ::viewsrc::

Last modified Wednesday 15 Feb 2023