Search:

Return to previous page

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




Deprecated: Function split() is deprecated in /storage/content/45/2011745/jonsson.eu/public_html/php/htmlicise.php on line 46
    1   % This Filename:  example-b.mp   [MetaPost source]
    2   % Creation time:  Thu Jan 23 20:19:26 2014
    3   %
    4   % Copyright (C) 1997-2005, Fredrik Jonsson <fj@optics.kth.se>
    5   %
    6   % Input Filename [Stokes parameters]:  example-b.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 --draw_hidden_dashed --inputfile example-b.dat --outputfile
   10   %     example-b.mp --axislengths 0.3 1.7 0.3 2.4
   11   %     0.3 1.5 --axislabels s_1(t) bot s_2(t)
   12   %     bot s_3(t) rt --rotatephi 15.0 --rotatepsi
   13   %     -60.0 --shading 0.75 0.99 --rhodivisor 50
   14   %     --phidivisor 80 --scalefactor 20.0 --paththickness 0.8
   15   %     --arrowthickness 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.000000;  % Rotation angle round y-axis (second rotation)
   51   alpha := -24.146108;    % == arctan(sin(rot_phi)*tan(rot_psi))
   52   beta  := -8.498781;    % == 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.0099,0.9999)--(-0.0407,0.9992)
  152       --(-0.0724,0.9974)--(-0.1047,0.9945);
  153      draw p scaled radius dashed evenly withcolor black;
  154      pickup pencircle scaled 0.800000 pt;
  155      p := makepath makepen (0.4936,0.8694)--(0.4669,0.8805)
  156       --(0.4335,0.8909)--(0.3935,0.9003)--(0.3475,0.9084)
  157       --(0.2958,0.9152)--(0.2391,0.9204)--(0.1781,0.9239)
  158       --(0.1134,0.9256)--(0.0460,0.9252)--(-0.0232,0.9228)
  159       --(-0.0935,0.9183)--(-0.1638,0.9117)--(-0.2332,0.9029)
  160       --(-0.3007,0.8919)--(-0.3654,0.8789)--(-0.4264,0.8639)
  161       --(-0.4827,0.8470)--(-0.5334,0.8283)--(-0.5779,0.8081)
  162       --(-0.6155,0.7864);
  163      draw p scaled radius dashed evenly withcolor black;
  164      pickup pencircle scaled 0.800000 pt;
  165      p := makepath makepen (0.7983,0.6010)--(0.7748,0.6189)
  166       --(0.7409,0.6360)--(0.6968,0.6521)--(0.6432,0.6668)
  167       --(0.5806,0.6798)--(0.5096,0.6909)--(0.4315,0.6998)
  168       --(0.3468,0.7063)--(0.2569,0.7102)--(0.1627,0.7115)
  169       --(0.0657,0.7098)--(-0.0330,0.7052)--(-0.1321,0.6977)
  170       --(-0.2303,0.6872)--(-0.3262,0.6738)--(-0.4185,0.6575)
  171       --(-0.5061,0.6385)--(-0.5877,0.6168)--(-0.6621,0.5928)
  172       --(-0.7284,0.5666)--(-0.7856,0.5385)--(-0.8328,0.5087)
  173       --(-0.8694,0.4775)--(-0.8948,0.4453);
  174      draw p scaled radius dashed evenly withcolor black;
  175      pickup pencircle scaled 0.800000 pt;
  176      p := makepath makepen (0.9682,0.2432)--(0.9496,0.2650)
  177       --(0.9186,0.2860)--(0.8754,0.3059)--(0.8206,0.3244)
  178       --(0.7549,0.3412)--(0.6791,0.3559)--(0.5942,0.3681)
  179       --(0.5014,0.3778)--(0.4018,0.3846)--(0.2966,0.3884)
  180       --(0.1873,0.3890)--(0.0754,0.3863)--(-0.0378,0.3803)
  181       --(-0.1506,0.3709)--(-0.2616,0.3582)--(-0.3695,0.3422)
  182       --(-0.4727,0.3230)--(-0.5698,0.3009)--(-0.6596,0.2759)
  183       --(-0.7409,0.2485)--(-0.8125,0.2186)--(-0.8736,0.1869)
  184       --(-0.9233,0.1535)--(-0.9609,0.1187)--(-0.9860,0.0830)
  185       --(-0.9982,0.0468);
  186      draw p scaled radius dashed evenly withcolor black;
  187      pickup pencircle scaled 0.800000 pt;
  188      p := makepath makepen (0.9865,-0.1555)--(0.9778,-0.1332)
  189       --(0.9564,-0.1115)--(0.9225,-0.0906)--(0.8766,-0.0708)
  190       --(0.8194,-0.0527)--(0.7517,-0.0364)--(0.6743,-0.0223)
  191       --(0.5884,-0.0106)--(0.4950,-0.0017)--(0.3956,0.0045)
  192       --(0.2912,0.0074)--(0.1833,0.0074)--(0.0736,0.0041)
  193       --(-0.0367,-0.0026)--(-0.1462,-0.0124)--(-0.2533,-0.0255)
  194       --(-0.3566,-0.0416)--(-0.4549,-0.0607)--(-0.5468,-0.0826)
  195       --(-0.6311,-0.1070)--(-0.7068,-0.1338)--(-0.7729,-0.1626)
  196       --(-0.8286,-0.1932)--(-0.8732,-0.2251)--(-0.9062,-0.2581)
  197       --(-0.9271,-0.2919)--(-0.9359,-0.3260)--(-0.9324,-0.3601);
  198      draw p scaled radius dashed evenly withcolor black;
  199      pickup pencircle scaled 0.800000 pt;
  200      p := makepath makepen (0.8480,-0.5278)--(0.8488,-0.5085)
  201       --(0.8386,-0.4894)--(0.8176,-0.4708)--(0.7860,-0.4532)
  202       --(0.7444,-0.4368)--(0.6935,-0.4217)--(0.6340,-0.4083)
  203       --(0.5668,-0.3970)--(0.4929,-0.3878)--(0.4133,-0.3809)
  204       --(0.3291,-0.3765)--(0.2414,-0.3746)--(0.1515,-0.3754)
  205       --(0.0605,-0.3789)--(-0.0301,-0.3850)--(-0.1195,-0.3938)
  206       --(-0.2063,-0.4052)--(-0.2894,-0.4190)--(-0.3678,-0.4351)
  207       --(-0.4405,-0.4534)--(-0.5064,-0.4736)--(-0.5651,-0.4956)
  208       --(-0.6156,-0.5191)--(-0.6575,-0.5437)--(-0.6902,-0.5694)
  209       --(-0.7135,-0.5957)--(-0.7271,-0.6224)--(-0.7311,-0.6492)
  210       --(-0.7254,-0.6757)--(-0.7103,-0.7018);
  211      draw p scaled radius dashed evenly withcolor black;
  212      pickup pencircle scaled 0.800000 pt;
  213      p := makepath makepen (0.5663,-0.8240)--(0.5794,-0.8107)
  214       --(0.5846,-0.7974)--(0.5820,-0.7840)--(0.5718,-0.7711)
  215       --(0.5543,-0.7586)--(0.5298,-0.7469)--(0.4988,-0.7362)
  216       --(0.4621,-0.7266)--(0.4198,-0.7183)--(0.3731,-0.7114)
  217       --(0.3225,-0.7059)--(0.2687,-0.7021)--(0.2125,-0.7000)
  218       --(0.1549,-0.6996)--(0.0966,-0.7010)--(0.0383,-0.7041)
  219       --(-0.0189,-0.7089)--(-0.0746,-0.7153)--(-0.1279,-0.7232)
  220       --(-0.1781,-0.7326)--(-0.2247,-0.7433)--(-0.2671,-0.7552)
  221       --(-0.3048,-0.7682)--(-0.3374,-0.7820)--(-0.3646,-0.7965)
  222       --(-0.3862,-0.8116)--(-0.4021,-0.8270)--(-0.4121,-0.8426)
  223       --(-0.4164,-0.8581)--(-0.4150,-0.8735)--(-0.4080,-0.8885)
  224       --(-0.3958,-0.9030)--(-0.3787,-0.9168)--(-0.3571,-0.9298)
  225       --(-0.3314,-0.9419)--(-0.3021,-0.9530);
  226      draw p scaled radius dashed evenly withcolor black;
  227      pickup pencircle scaled 0.800000 pt;
  228      p := makepath makepen (0.1513,-0.9884)--(0.1742,-0.9841)
  229       --(0.1934,-0.9793)--(0.2090,-0.9740)--(0.2210,-0.9684)
  230       --(0.2292,-0.9627)--(0.2338,-0.9568)--(0.2346,-0.9511)
  231       --(0.2322,-0.9455)--(0.2265,-0.9403)--(0.2179,-0.9354)
  232       --(0.2066,-0.9309)--(0.1930,-0.9269)--(0.1774,-0.9236)
  233       --(0.1602,-0.9208)--(0.1418,-0.9187)--(0.1226,-0.9173)
  234       --(0.1028,-0.9166)--(0.0831,-0.9165)--(0.0637,-0.9171)
  235       --(0.0448,-0.9182)--(0.0269,-0.9199)--(0.0103,-0.9222)
  236       --(-0.0049,-0.9248)--(-0.0184,-0.9279)--(-0.0300,-0.9312)
  237       --(-0.0397,-0.9347)--(-0.0475,-0.9384)--(-0.0530,-0.9421)
  238       --(-0.0567,-0.9458)--(-0.0583,-0.9494)--(-0.0581,-0.9527)
  239       --(-0.0563,-0.9559)--(-0.0528,-0.9587)--(-0.0480,-0.9612)
  240       --(-0.0423,-0.9633)--(-0.0356,-0.9649)--(-0.0285,-0.9660)
  241       --(-0.0211,-0.9667)--(-0.0136,-0.9669)--(-0.0065,-0.9666)
  242       --(-0.0000,-0.9659);
  243      draw p scaled radius dashed evenly withcolor black;
  244      pickup pencircle scaled 0.400000 pt;
  245      label.urt(btex LCP etex,(0.000000,0.965926)*radius);
  246      label.lrt(btex RCP etex,(-0.000000,-0.965926)*radius);
  247     ahangle:=oldahangle;
  248     oldahangle:=ahangle;
  249     ahangle:=30.000000;
  250     pickup pencircle scaled 0.800000 pt;
  251      pickup pencircle scaled 0.800000 pt;
  252      p := makepath makepen (0.0000,0.9659)--(-0.0057,0.9648)
  253       --(-0.0104,0.9633)--(-0.0139,0.9615)--(-0.0159,0.9594)
  254       --(-0.0163,0.9571)--(-0.0152,0.9547)--(-0.0122,0.9522)
  255       --(-0.0076,0.9497)--(-0.0013,0.9473)--(0.0068,0.9451)
  256       --(0.0163,0.9431)--(0.0272,0.9414)--(0.0393,0.9401)
  257       --(0.0523,0.9391)--(0.0661,0.9386)--(0.0802,0.9387)
  258       --(0.0944,0.9392)--(0.1085,0.9403)--(0.1219,0.9419)
  259       --(0.1345,0.9440)--(0.1458,0.9467)--(0.1556,0.9498)
  260       --(0.1635,0.9533)--(0.1692,0.9572)--(0.1726,0.9614)
  261       --(0.1733,0.9658)--(0.1711,0.9703)--(0.1661,0.9749)
  262       --(0.1579,0.9794)--(0.1467,0.9837)--(0.1324,0.9877)
  263       --(0.1151,0.9913)--(0.0950,0.9944)--(0.0721,0.9970)
  264       --(0.0468,0.9988)--(0.0193,0.9998)--(-0.0099,0.9999);
  265      draw p scaled radius withcolor black;
  266      pickup pencircle scaled 0.800000 pt;
  267      p := makepath makepen (-0.1047,0.9945)--(-0.1371,0.9905)
  268       --(-0.1691,0.9855)--(-0.2001,0.9794)--(-0.2296,0.9722)
  269       --(-0.2573,0.9639)--(-0.2824,0.9546)--(-0.3046,0.9445)
  270       --(-0.3233,0.9335)--(-0.3383,0.9217)--(-0.3491,0.9093)
  271       --(-0.3553,0.8964)--(-0.3569,0.8832)--(-0.3535,0.8697)
  272       --(-0.3450,0.8563)--(-0.3314,0.8429)--(-0.3127,0.8297)
  273       --(-0.2890,0.8170)--(-0.2606,0.8049)--(-0.2276,0.7935)
  274       --(-0.1904,0.7830)--(-0.1493,0.7736)--(-0.1049,0.7653)
  275       --(-0.0578,0.7583)--(-0.0084,0.7527)--(0.0426,0.7484)
  276       --(0.0944,0.7457)--(0.1464,0.7445)--(0.1979,0.7449)
  277       --(0.2481,0.7468)--(0.2963,0.7503)--(0.3417,0.7551)
  278       --(0.3836,0.7615)--(0.4215,0.7690)--(0.4545,0.7778)
  279       --(0.4822,0.7875)--(0.5041,0.7981)--(0.5196,0.8095)
  280       --(0.5286,0.8213)--(0.5306,0.8334)--(0.5253,0.8456)
  281       --(0.5130,0.8577)--(0.4936,0.8694);
  282      draw p scaled radius withcolor black;
  283      pickup pencircle scaled 0.800000 pt;
  284      p := makepath makepen (-0.6155,0.7864)--(-0.6455,0.7636)
  285       --(-0.6674,0.7398)--(-0.6806,0.7154)--(-0.6851,0.6904)
  286       --(-0.6805,0.6653)--(-0.6668,0.6402)--(-0.6441,0.6155)
  287       --(-0.6124,0.5915)--(-0.5721,0.5683)--(-0.5237,0.5464)
  288       --(-0.4676,0.5258)--(-0.4046,0.5069)--(-0.3354,0.4898)
  289       --(-0.2607,0.4748)--(-0.1817,0.4620)--(-0.0991,0.4515)
  290       --(-0.0142,0.4434)--(0.0719,0.4378)--(0.1581,0.4348)
  291       --(0.2433,0.4343)--(0.3263,0.4363)--(0.4061,0.4409)
  292       --(0.4813,0.4477)--(0.5511,0.4567)--(0.6144,0.4678)
  293       --(0.6703,0.4806)--(0.7178,0.4952)--(0.7565,0.5111)
  294       --(0.7856,0.5280)--(0.8046,0.5459)--(0.8132,0.5642)
  295       --(0.8111,0.5826)--(0.7983,0.6010);
  296      draw p scaled radius withcolor black;
  297      pickup pencircle scaled 0.800000 pt;
  298      p := makepath makepen (-0.8948,0.4453)--(-0.9086,0.4125)
  299       --(-0.9105,0.3793)--(-0.9005,0.3461)--(-0.8786,0.3132)
  300       --(-0.8450,0.2811)--(-0.8001,0.2501)--(-0.7444,0.2205)
  301       --(-0.6786,0.1926)--(-0.6035,0.1666)--(-0.5201,0.1430)
  302       --(-0.4293,0.1220)--(-0.3324,0.1037)--(-0.2308,0.0882)
  303       --(-0.1255,0.0759)--(-0.0180,0.0667)--(0.0902,0.0606)
  304       --(0.1977,0.0577)--(0.3032,0.0580)--(0.4051,0.0614)
  305       --(0.5022,0.0678)--(0.5932,0.0769)--(0.6766,0.0887)
  306       --(0.7516,0.1029)--(0.8170,0.1192)--(0.8719,0.1372)
  307       --(0.9156,0.1568)--(0.9475,0.1777)--(0.9671,0.1992)
  308       --(0.9740,0.2212)--(0.9682,0.2432);
  309      draw p scaled radius withcolor black;
  310      pickup pencircle scaled 0.800000 pt;
  311      p := makepath makepen (-0.9982,0.0468)--(-0.9974,0.0104)
  312       --(-0.9835,-0.0259)--(-0.9567,-0.0615)--(-0.9174,-0.0962)
  313       --(-0.8660,-0.1294)--(-0.8034,-0.1610)--(-0.7302,-0.1906)
  314       --(-0.6475,-0.2178)--(-0.5564,-0.2426)--(-0.4579,-0.2644)
  315       --(-0.3536,-0.2832)--(-0.2447,-0.2989)--(-0.1327,-0.3113)
  316       --(-0.0190,-0.3203)--(0.0948,-0.3259)--(0.2072,-0.3282)
  317       --(0.3169,-0.3272)--(0.4222,-0.3229)--(0.5219,-0.3157)
  318       --(0.6146,-0.3055)--(0.6992,-0.2928)--(0.7744,-0.2777)
  319       --(0.8394,-0.2605)--(0.8933,-0.2415)--(0.9354,-0.2212)
  320       --(0.9652,-0.1999)--(0.9823,-0.1778)--(0.9865,-0.1555);
  321      draw p scaled radius withcolor black;
  322      pickup pencircle scaled 0.800000 pt;
  323      p := makepath makepen (-0.9324,-0.3601)--(-0.9167,-0.3938)
  324       --(-0.8891,-0.4268)--(-0.8500,-0.4588)--(-0.8001,-0.4892)
  325       --(-0.7400,-0.5180)--(-0.6706,-0.5447)--(-0.5929,-0.5692)
  326       --(-0.5079,-0.5912)--(-0.4168,-0.6105)--(-0.3209,-0.6270)
  327       --(-0.2214,-0.6405)--(-0.1197,-0.6510)--(-0.0171,-0.6584)
  328       --(0.0850,-0.6628)--(0.1853,-0.6641)--(0.2824,-0.6624)
  329       --(0.3750,-0.6581)--(0.4622,-0.6510)--(0.5426,-0.6415)
  330       --(0.6152,-0.6297)--(0.6793,-0.6160)--(0.7340,-0.6005)
  331       --(0.7786,-0.5836)--(0.8127,-0.5657)--(0.8359,-0.5470)
  332       --(0.8480,-0.5278);
  333      draw p scaled radius withcolor black;
  334      pickup pencircle scaled 0.800000 pt;
  335      p := makepath makepen (-0.7103,-0.7018)--(-0.6861,-0.7272)
  336       --(-0.6533,-0.7515)--(-0.6124,-0.7745)--(-0.5641,-0.7960)
  337       --(-0.5089,-0.8159)--(-0.4480,-0.8339)--(-0.3821,-0.8499)
  338       --(-0.3122,-0.8637)--(-0.2394,-0.8753)--(-0.1644,-0.8846)
  339       --(-0.0884,-0.8916)--(-0.0125,-0.8963)--(0.0623,-0.8987)
  340       --(0.1350,-0.8989)--(0.2048,-0.8970)--(0.2708,-0.8930)
  341       --(0.3321,-0.8872)--(0.3879,-0.8797)--(0.4377,-0.8708)
  342       --(0.4808,-0.8605)--(0.5169,-0.8491)--(0.5455,-0.8368)
  343       --(0.5663,-0.8240);
  344      draw p scaled radius withcolor black;
  345      pickup pencircle scaled 0.800000 pt;
  346      p := makepath makepen (-0.3021,-0.9530)--(-0.2698,-0.9629)
  347       --(-0.2350,-0.9717)--(-0.1982,-0.9792)--(-0.1602,-0.9854)
  348       --(-0.1213,-0.9904)--(-0.0823,-0.9941)--(-0.0438,-0.9965)
  349       --(-0.0062,-0.9978)--(0.0300,-0.9979)--(0.0642,-0.9969)
  350       --(0.0961,-0.9949)--(0.1252,-0.9921)--(0.1513,-0.9884);
  351      draw p scaled radius withcolor black;
  352      pickup pencircle scaled 0.400000 pt;
  353      label.urt(btex LCP etex,(0.000000,0.965926)*radius);
  354      label.lrt(btex RCP etex,(-0.000000,-0.965926)*radius);
  355     ahangle:=oldahangle;
  356   %
  357   % Draw the $S_1$-, $S_2$- and $S_3$-axis of the Poincare sphere.
  358   % First of all, calculate the transformations of the intersections
  359   % for the unity sphere.
  360   %
  361   % Used variables:
  362   %
  363   %    behind_distance : Specifies the relative distance of the coordi-
  364   %                      axes to be plotted behind origo (in negative di-
  365   %                      rection of respective axis.
  366   %
  367   %   outside_distance_s1 : The relative distance from origo to the point
  368   %                         of the arrow head of the coordinate axis S1.
  369   %                         If this is set to 1.0, the arrow head will
  370   %                         point directly at the Poincare sphere.
  371   %
  372   %   outside_distance_s2 : Same as above, except that this one controls
  373   %                         the S2 coordinate axis instead.
  374   %
  375   %   outside_distance_s3 : Same as above, except that this one controls
  376   %                         the S3 coordinate axis instead.
  377   %
  378   %    insidecolval :    Specifies the shade of gray to use for the parts
  379   %                      of the coordinate axes that are inside the Poin-
  380   %                      care sphere. Values must be between 0 and 1,
  381   %                      where:  '0.0' <=> 'white';  '1.0' <=> 'black'
  382   %
  383      behind_distance_s1  := -0.300000;
  384      behind_distance_s2  := -0.300000;
  385      behind_distance_s3  := -0.300000;
  386      outside_distance_s1 :=  1.700000;
  387      outside_distance_s2 :=  2.400000;
  388      outside_distance_s3 :=  1.500000;
  389      insidecolval := .85;    % '0.0' <=> 'white';  '1.0' <=> 'black'
  390   
  391      pickup pencircle scaled 0.600000 pt;
  392   %
  393   % Start with drawing the x-axis...
  394   %
  395      x_bis_start :=  radius*behind_distance_s1*cosd(rot_psi)*cosd(rot_phi);
  396      y_bis_start :=  radius*behind_distance_s1*sind(rot_psi);
  397      z_bis_start := -radius*behind_distance_s1*cosd(rot_psi)*sind(rot_phi);
  398      x_bis_intersect :=  radius*cosd(rot_psi)*cosd(rot_phi);
  399      y_bis_intersect :=  radius*sind(rot_psi);
  400      z_bis_intersect := -radius*cosd(rot_psi)*sind(rot_phi);
  401      p := makepath makepen (y_bis_intersect,z_bis_intersect)--
  402                (outside_distance_s1*y_bis_intersect,
  403                 outside_distance_s1*z_bis_intersect);
  404      drawarrow p;
  405      label.bot(btex $s_1(t)$ etex,
  406                (outside_distance_s1*y_bis_intersect,
  407                 outside_distance_s1*z_bis_intersect));
  408   
  409   %
  410   % ... then draw the y-axis ...
  411   %
  412      x_bis_start := -radius*behind_distance_s2*sind(rot_psi)*cosd(rot_phi);
  413      y_bis_start :=  radius*behind_distance_s2*cosd(rot_psi);
  414      z_bis_start :=  radius*behind_distance_s2*sind(rot_psi)*sind(rot_phi);
  415      x_bis_intersect := -radius*sind(rot_psi)*cosd(rot_phi);
  416      y_bis_intersect :=  radius*cosd(rot_psi);
  417      z_bis_intersect :=  radius*sind(rot_psi)*sind(rot_phi);
  418      p := makepath makepen (y_bis_intersect,z_bis_intersect)--
  419                (outside_distance_s2*y_bis_intersect,
  420                 outside_distance_s2*z_bis_intersect);
  421      drawarrow p;
  422      label.bot(btex $s_2(t)$ etex,
  423                (outside_distance_s2*y_bis_intersect,
  424                 outside_distance_s2*z_bis_intersect));
  425   
  426   %
  427   % ... then, finally, draw the z-axis.
  428   %
  429      x_bis_start := radius*behind_distance_s3*sind(rot_phi);
  430      y_bis_start := 0.0;
  431      z_bis_start := radius*behind_distance_s3*cosd(rot_phi);
  432      x_bis_intersect := radius*sind(rot_phi);
  433      y_bis_intersect := 0.0;
  434      z_bis_intersect := radius*cosd(rot_phi);
  435      p := makepath makepen (y_bis_intersect,z_bis_intersect)--
  436                (outside_distance_s3*y_bis_intersect,
  437                 outside_distance_s3*z_bis_intersect);
  438      drawarrow p;
  439      label.rt(btex $s_3(t)$ etex,
  440                (outside_distance_s3*y_bis_intersect,
  441                 outside_distance_s3*z_bis_intersect));
  442   
  443      endfig;
  444   end
  445   

Return to previous page

Generated by ::viewsrc::

Last modified Thursday 23 Jan 2014