Search:

Return to previous page

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



    1   % This Filename:  example-cs.mp   [MetaPost source]
    2   % Creation time:  Thu Jan 23 20:19:28 2014
    3   %
    4   % Copyright (C) 1997-2005, Fredrik Jonsson <fj@optics.kth.se>
    5   %
    6   % Input Filename [Stokes parameters]:  example-cs.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 --bezier --inputfile example-cs.dat --outputfile
   10   %     example-cs.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) urt --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 --arrowheadangle 20.0 --draw_paths_as_arrows
   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:=20.000000;
  149     pickup pencircle scaled 0.800000 pt;
  150      pickup pencircle scaled 0.800000 pt;
  151      p := makepath makepen (0.9883,0.1506)..(0.9814,0.1857)
  152       ..(0.9727,0.2205)..(0.9622,0.2550)..(0.9499,0.2893)
  153       ..(0.9359,0.3230)..(0.9202,0.3564)..(0.9029,0.3893)
  154       ..(0.8841,0.4216)..(0.8638,0.4534)..(0.8422,0.4845)
  155       ..(0.8192,0.5150)..(0.7950,0.5447)..(0.7696,0.5738)
  156       ..(0.7433,0.6020)..(0.7160,0.6295)..(0.6879,0.6561)
  157       ..(0.6591,0.6818)..(0.6296,0.7067)..(0.5996,0.7306)
  158       ..(0.5693,0.7536)..(0.5386,0.7756)..(0.5079,0.7966)
  159       ..(0.4771,0.8166)..(0.4462,0.8356)..(0.4156,0.8535)
  160       ..(0.3854,0.8704)..(0.3554,0.8863)..(0.3261,0.9011)
  161       ..(0.2974,0.9149)..(0.2694,0.9276)..(0.2423,0.9392)
  162       ..(0.2160,0.9499)..(0.1909,0.9594)..(0.1670,0.9679)
  163       ..(0.1442,0.9753)..(0.1227,0.9817)..(0.1026,0.9872)
  164       ..(0.0841,0.9916)..(0.0670,0.9950)..(0.0516,0.9975);
  165      drawarrow p scaled radius withcolor 0.650000 [black,white];
  166      pickup pencircle scaled 0.400000 pt;
  167      pickup pencircle scaled 0.800000 pt;
  168      p := makepath makepen (0.8390,-0.5439)..(0.8570,-0.5140)
  169       ..(0.8735,-0.4834)..(0.8885,-0.4521)..(0.9018,-0.4203)
  170       ..(0.9134,-0.3879)..(0.9232,-0.3551)..(0.9312,-0.3218)
  171       ..(0.9374,-0.2881)..(0.9418,-0.2540)..(0.9442,-0.2196)
  172       ..(0.9448,-0.1850)..(0.9435,-0.1502)..(0.9403,-0.1152)
  173       ..(0.9351,-0.0802)..(0.9281,-0.0451)..(0.9193,-0.0100)
  174       ..(0.9086,0.0250)..(0.8962,0.0600)..(0.8820,0.0948)
  175       ..(0.8660,0.1294)..(0.8485,0.1637)..(0.8293,0.1978)
  176       ..(0.8086,0.2316)..(0.7865,0.2649)..(0.7630,0.2978)
  177       ..(0.7382,0.3303)..(0.7123,0.3622)..(0.6852,0.3935)
  178       ..(0.6571,0.4244)..(0.6281,0.4545)..(0.5983,0.4841)
  179       ..(0.5678,0.5130)..(0.5367,0.5411)..(0.5052,0.5685)
  180       ..(0.4732,0.5951)..(0.4411,0.6210)..(0.4088,0.6460)
  181       ..(0.3764,0.6702)..(0.3442,0.6935)..(0.3122,0.7159)
  182       ..(0.2806,0.7375)..(0.2493,0.7582)..(0.2186,0.7780)
  183       ..(0.1885,0.7968)..(0.1593,0.8148)..(0.1309,0.8318)
  184       ..(0.1035,0.8480)..(0.0771,0.8632)..(0.0519,0.8775)
  185       ..(0.0280,0.8908)..(0.0054,0.9033)..(-0.0157,0.9149)
  186       ..(-0.0354,0.9256)..(-0.0536,0.9354)..(-0.0701,0.9444)
  187       ..(-0.0849,0.9525)..(-0.0980,0.9598)..(-0.1094,0.9662)
  188       ..(-0.1190,0.9719)..(-0.1267,0.9768)..(-0.1326,0.9809)
  189       ..(-0.1366,0.9843)..(-0.1388,0.9870)..(-0.1390,0.9890)
  190       ..(-0.1374,0.9903);
  191      drawarrow p scaled radius withcolor 0.650000 [black,white];
  192      pickup pencircle scaled 0.400000 pt;
  193      pickup pencircle scaled 0.800000 pt;
  194      p := makepath makepen (0.3182,-0.9375)..(0.3467,-0.9272)
  195       ..(0.3749,-0.9158)..(0.4030,-0.9032)..(0.4306,-0.8894)
  196       ..(0.4578,-0.8745)..(0.4842,-0.8585)..(0.5100,-0.8414)
  197       ..(0.5351,-0.8231)..(0.5591,-0.8038)..(0.5821,-0.7835)
  198       ..(0.6040,-0.7622)..(0.6246,-0.7399)..(0.6440,-0.7166)
  199       ..(0.6619,-0.6925)..(0.6784,-0.6676)..(0.6935,-0.6416)
  200       ..(0.7069,-0.6150)..(0.7185,-0.5877)..(0.7286,-0.5596)
  201       ..(0.7368,-0.5308)..(0.7433,-0.5015)..(0.7479,-0.4716)
  202       ..(0.7506,-0.4411)..(0.7515,-0.4102)..(0.7505,-0.3788)
  203       ..(0.7476,-0.3471)..(0.7429,-0.3149)..(0.7362,-0.2826)
  204       ..(0.7277,-0.2499)..(0.7173,-0.2171)..(0.7051,-0.1842)
  205       ..(0.6911,-0.1511)..(0.6754,-0.1180)..(0.6581,-0.0849)
  206       ..(0.6390,-0.0518)..(0.6185,-0.0188)..(0.5964,0.0140)
  207       ..(0.5728,0.0466)..(0.5480,0.0790)..(0.5219,0.1112)
  208       ..(0.4946,0.1431)..(0.4662,0.1746)..(0.4370,0.2057)
  209       ..(0.4067,0.2364)..(0.3758,0.2667)..(0.3441,0.2965)
  210       ..(0.3119,0.3258)..(0.2793,0.3545)..(0.2463,0.3827)
  211       ..(0.2131,0.4103)..(0.1798,0.4372)..(0.1465,0.4635)
  212       ..(0.1133,0.4892)..(0.0805,0.5141)..(0.0479,0.5385)
  213       ..(0.0158,0.5621)..(-0.0156,0.5849)..(-0.0464,0.6071)
  214       ..(-0.0764,0.6285)..(-0.1055,0.6492)..(-0.1336,0.6691)
  215       ..(-0.1605,0.6883)..(-0.1864,0.7067)..(-0.2109,0.7244)
  216       ..(-0.2340,0.7414)..(-0.2558,0.7576)..(-0.2760,0.7731)
  217       ..(-0.2946,0.7879)..(-0.3115,0.8020)..(-0.3269,0.8154)
  218       ..(-0.3404,0.8280)..(-0.3522,0.8400)..(-0.3621,0.8514)
  219       ..(-0.3703,0.8621)..(-0.3765,0.8721)..(-0.3809,0.8816)
  220       ..(-0.3834,0.8904)..(-0.3841,0.8986)..(-0.3828,0.9063)
  221       ..(-0.3797,0.9134)..(-0.3747,0.9200)..(-0.3680,0.9261)
  222       ..(-0.3594,0.9317)..(-0.3492,0.9368);
  223      draw p scaled radius withcolor 0.650000 [black,white];
  224      pickup pencircle scaled 0.400000 pt;
  225      pickup pencircle scaled 0.800000 pt;
  226      p := makepath makepen (0.3199,-0.8838)..(0.3410,-0.8694)
  227       ..(0.3609,-0.8539)..(0.3795,-0.8374)..(0.3966,-0.8199)
  228       ..(0.4124,-0.8014)..(0.4266,-0.7819)..(0.4391,-0.7615)
  229       ..(0.4500,-0.7402)..(0.4592,-0.7182)..(0.4666,-0.6953)
  230       ..(0.4722,-0.6717)..(0.4761,-0.6473)..(0.4780,-0.6223)
  231       ..(0.4781,-0.5966)..(0.4762,-0.5704)..(0.4726,-0.5436)
  232       ..(0.4670,-0.5163)..(0.4596,-0.4886)..(0.4502,-0.4605)
  233       ..(0.4392,-0.4319)..(0.4263,-0.4031)..(0.4116,-0.3740)
  234       ..(0.3951,-0.3448)..(0.3771,-0.3152)..(0.3574,-0.2856)
  235       ..(0.3362,-0.2559)..(0.3135,-0.2261)..(0.2894,-0.1963)
  236       ..(0.2640,-0.1665)..(0.2374,-0.1368)..(0.2097,-0.1072)
  237       ..(0.1809,-0.0778)..(0.1511,-0.0485)..(0.1205,-0.0194)
  238       ..(0.0891,0.0094)..(0.0571,0.0380)..(0.0247,0.0662)
  239       ..(-0.0083,0.0941)..(-0.0415,0.1216)..(-0.0749,0.1488)
  240       ..(-0.1083,0.1755)..(-0.1418,0.2019)..(-0.1749,0.2278)
  241       ..(-0.2079,0.2532)..(-0.2404,0.2781)..(-0.2726,0.3025)
  242       ..(-0.3039,0.3265)..(-0.3347,0.3499)..(-0.3645,0.3728)
  243       ..(-0.3935,0.3951)..(-0.4214,0.4168)..(-0.4482,0.4381)
  244       ..(-0.4737,0.4589)..(-0.4979,0.4790)..(-0.5208,0.4987)
  245       ..(-0.5422,0.5178)..(-0.5621,0.5363)..(-0.5803,0.5544)
  246       ..(-0.5970,0.5718)..(-0.6118,0.5888)..(-0.6250,0.6053)
  247       ..(-0.6363,0.6213)..(-0.6458,0.6368)..(-0.6534,0.6517)
  248       ..(-0.6592,0.6663)..(-0.6631,0.6804)..(-0.6651,0.6940)
  249       ..(-0.6652,0.7072)..(-0.6634,0.7200)..(-0.6598,0.7324)
  250       ..(-0.6543,0.7444)..(-0.6470,0.7560)..(-0.6379,0.7673)
  251       ..(-0.6272,0.7782)..(-0.6147,0.7888);
  252      draw p scaled radius withcolor 0.650000 [black,white];
  253      pickup pencircle scaled 0.400000 pt;
  254      pickup pencircle scaled 0.800000 pt;
  255      p := makepath makepen (0.1994,-0.8401)..(0.2052,-0.8235)
  256       ..(0.2090,-0.8060)..(0.2110,-0.7878)..(0.2112,-0.7687)
  257       ..(0.2095,-0.7491)..(0.2058,-0.7287)..(0.2004,-0.7077)
  258       ..(0.1931,-0.6862)..(0.1839,-0.6641)..(0.1729,-0.6415)
  259       ..(0.1602,-0.6185)..(0.1456,-0.5950)..(0.1294,-0.5712)
  260       ..(0.1116,-0.5470)..(0.0921,-0.5226)..(0.0712,-0.4979)
  261       ..(0.0488,-0.4729)..(0.0251,-0.4479)..(-0.0000,-0.4226)
  262       ..(-0.0262,-0.3972)..(-0.0536,-0.3718)..(-0.0820,-0.3463)
  263       ..(-0.1113,-0.3209)..(-0.1415,-0.2954)..(-0.1722,-0.2700)
  264       ..(-0.2037,-0.2448)..(-0.2356,-0.2196)..(-0.2679,-0.1945)
  265       ..(-0.3004,-0.1695)..(-0.3332,-0.1449)..(-0.3658,-0.1204)
  266       ..(-0.3985,-0.0961)..(-0.4309,-0.0720)..(-0.4631,-0.0482)
  267       ..(-0.4948,-0.0247)..(-0.5259,-0.0014)..(-0.5565,0.0215)
  268       ..(-0.5862,0.0441)..(-0.6151,0.0664)..(-0.6430,0.0884)
  269       ..(-0.6699,0.1101)..(-0.6955,0.1315)..(-0.7200,0.1525)
  270       ..(-0.7431,0.1732)..(-0.7649,0.1935)..(-0.7850,0.2136)
  271       ..(-0.8037,0.2333)..(-0.8207,0.2527)..(-0.8361,0.2718)
  272       ..(-0.8497,0.2906)..(-0.8616,0.3090)..(-0.8716,0.3271)
  273       ..(-0.8798,0.3451)..(-0.8862,0.3626)..(-0.8906,0.3800)
  274       ..(-0.8931,0.3971)..(-0.8938,0.4139)..(-0.8925,0.4305)
  275       ..(-0.8894,0.4469)..(-0.8844,0.4630)..(-0.8776,0.4790);
  276      draw p scaled radius withcolor 0.650000 [black,white];
  277      pickup pencircle scaled 0.400000 pt;
  278      pickup pencircle scaled 0.800000 pt;
  279      p := makepath makepen (0.0028,-0.8231)..(-0.0091,-0.8070)
  280       ..(-0.0227,-0.7903)..(-0.0380,-0.7732)..(-0.0549,-0.7556)
  281       ..(-0.0735,-0.7376)..(-0.0934,-0.7192)..(-0.1149,-0.7005)
  282       ..(-0.1376,-0.6815)..(-0.1616,-0.6622)..(-0.1868,-0.6427)
  283       ..(-0.2131,-0.6230)..(-0.2404,-0.6030)..(-0.2686,-0.5829)
  284       ..(-0.2975,-0.5627)..(-0.3272,-0.5424)..(-0.3574,-0.5219)
  285       ..(-0.3881,-0.5014)..(-0.4190,-0.4810)..(-0.4503,-0.4605)
  286       ..(-0.4817,-0.4400)..(-0.5130,-0.4194)..(-0.5442,-0.3990)
  287       ..(-0.5752,-0.3786)..(-0.6059,-0.3583)..(-0.6361,-0.3380)
  288       ..(-0.6658,-0.3179)..(-0.6947,-0.2978)..(-0.7229,-0.2778)
  289       ..(-0.7502,-0.2579)..(-0.7765,-0.2382)..(-0.8016,-0.2185)
  290       ..(-0.8256,-0.1991)..(-0.8484,-0.1796)..(-0.8698,-0.1603)
  291       ..(-0.8897,-0.1411)..(-0.9082,-0.1220)..(-0.9250,-0.1031)
  292       ..(-0.9403,-0.0843)..(-0.9538,-0.0655)..(-0.9656,-0.0469)
  293       ..(-0.9756,-0.0283)..(-0.9838,-0.0097)..(-0.9901,0.0087)
  294       ..(-0.9945,0.0271)..(-0.9971,0.0454)..(-0.9977,0.0637);
  295      draw p scaled radius withcolor 0.650000 [black,white];
  296      pickup pencircle scaled 0.400000 pt;
  297      pickup pencircle scaled 0.800000 pt;
  298      p := makepath makepen (-0.1949,-0.8393)..(-0.2198,-0.8262)
  299       ..(-0.2457,-0.8129)..(-0.2725,-0.7993)..(-0.3001,-0.7855)
  300       ..(-0.3283,-0.7714)..(-0.3571,-0.7571)..(-0.3862,-0.7427)
  301       ..(-0.4157,-0.7281)..(-0.4454,-0.7133)..(-0.4752,-0.6984)
  302       ..(-0.5050,-0.6833)..(-0.5347,-0.6681)..(-0.5640,-0.6529)
  303       ..(-0.5930,-0.6375)..(-0.6215,-0.6221)..(-0.6495,-0.6066)
  304       ..(-0.6767,-0.5910)..(-0.7031,-0.5753)..(-0.7286,-0.5596)
  305       ..(-0.7530,-0.5438)..(-0.7764,-0.5279)..(-0.7986,-0.5119)
  306       ..(-0.8195,-0.4959)..(-0.8390,-0.4798)..(-0.8570,-0.4636)
  307       ..(-0.8735,-0.4473)..(-0.8885,-0.4309)..(-0.9018,-0.4144)
  308       ..(-0.9134,-0.3978)..(-0.9232,-0.3811)..(-0.9312,-0.3643);
  309      draw p scaled radius withcolor 0.650000 [black,white];
  310      pickup pencircle scaled 0.400000 pt;
  311      pickup pencircle scaled 0.800000 pt;
  312      p := makepath makepen (-0.3182,-0.8824)..(-0.3467,-0.8739)
  313       ..(-0.3749,-0.8651)..(-0.4030,-0.8561)..(-0.4306,-0.8469)
  314       ..(-0.4578,-0.8375)..(-0.4842,-0.8279)..(-0.5100,-0.8181)
  315       ..(-0.5351,-0.8080)..(-0.5591,-0.7977)..(-0.5821,-0.7873)
  316       ..(-0.6040,-0.7766)..(-0.6246,-0.7657)..(-0.6440,-0.7545)
  317       ..(-0.6619,-0.7431)..(-0.6784,-0.7315)..(-0.6935,-0.7195)
  318       ..(-0.7069,-0.7073);
  319      draw p scaled radius withcolor 0.650000 [black,white];
  320      pickup pencircle scaled 0.400000 pt;
  321      pickup pencircle scaled 0.800000 pt;
  322      p := makepath makepen (-0.3199,-0.9361)..(-0.3410,-0.9317)
  323       ..(-0.3609,-0.9270)..(-0.3795,-0.9219)..(-0.3966,-0.9165)
  324       ..(-0.4124,-0.9107);
  325      draw p scaled radius withcolor 0.650000 [black,white];
  326      pickup pencircle scaled 0.400000 pt;
  327      pickup pencircle scaled 0.800000 pt;
  328      p := makepath makepen (0.5631,0.8264)..(0.5347,0.8450)
  329       ..(0.5060,0.8624)..(0.4769,0.8788)..(0.4477,0.8940)
  330       ..(0.4184,0.9081)..(0.3891,0.9211)..(0.3599,0.9329)
  331       ..(0.3312,0.9436);
  332      draw p scaled radius withcolor 0.650000 [black,white];
  333      pickup pencircle scaled 0.400000 pt;
  334     ahangle:=oldahangle;
  335     oldahangle:=ahangle;
  336     ahangle:=20.000000;
  337     pickup pencircle scaled 0.800000 pt;
  338      pickup pencircle scaled 0.800000 pt;
  339      p := makepath makepen (-0.0028,-0.9968)..(0.0091,-0.9941)
  340       ..(0.0227,-0.9906)..(0.0380,-0.9861)..(0.0549,-0.9807)
  341       ..(0.0735,-0.9744)..(0.0934,-0.9671)..(0.1149,-0.9588)
  342       ..(0.1376,-0.9496)..(0.1616,-0.9393)..(0.1868,-0.9281)
  343       ..(0.2131,-0.9158)..(0.2404,-0.9025)..(0.2686,-0.8882)
  344       ..(0.2975,-0.8729)..(0.3272,-0.8566)..(0.3574,-0.8393)
  345       ..(0.3881,-0.8209)..(0.4190,-0.8016)..(0.4503,-0.7813)
  346       ..(0.4817,-0.7600)..(0.5130,-0.7377)..(0.5442,-0.7145)
  347       ..(0.5752,-0.6904)..(0.6059,-0.6654)..(0.6361,-0.6395)
  348       ..(0.6658,-0.6128)..(0.6947,-0.5853)..(0.7229,-0.5569)
  349       ..(0.7502,-0.5278)..(0.7765,-0.4980)..(0.8016,-0.4675)
  350       ..(0.8256,-0.4363)..(0.8484,-0.4045)..(0.8698,-0.3721)
  351       ..(0.8897,-0.3393)..(0.9082,-0.3059)..(0.9250,-0.2721)
  352       ..(0.9403,-0.2379)..(0.9538,-0.2034)..(0.9656,-0.1685)
  353       ..(0.9756,-0.1334)..(0.9838,-0.0981)..(0.9901,-0.0626)
  354       ..(0.9945,-0.0271)..(0.9971,0.0085)..(0.9977,0.0441)
  355       ..(0.9965,0.0798)..(0.9933,0.1153)..(0.9883,0.1506);
  356      draw p scaled radius withcolor black;
  357      pickup pencircle scaled 0.400000 pt;
  358      pickup pencircle scaled 0.800000 pt;
  359      p := makepath makepen (0.1949,-0.9806)..(0.2198,-0.9749)
  360       ..(0.2457,-0.9680)..(0.2725,-0.9600)..(0.3001,-0.9509)
  361       ..(0.3283,-0.9406)..(0.3571,-0.9292)..(0.3862,-0.9167)
  362       ..(0.4157,-0.9031)..(0.4454,-0.8883)..(0.4752,-0.8724)
  363       ..(0.5050,-0.8554)..(0.5347,-0.8373)..(0.5640,-0.8182)
  364       ..(0.5930,-0.7980)..(0.6215,-0.7769)..(0.6495,-0.7546)
  365       ..(0.6767,-0.7314)..(0.7031,-0.7072)..(0.7286,-0.6821)
  366       ..(0.7530,-0.6561)..(0.7764,-0.6293)..(0.7986,-0.6016)
  367       ..(0.8195,-0.5731)..(0.8390,-0.5439);
  368      draw p scaled radius withcolor black;
  369      pickup pencircle scaled 0.400000 pt;
  370      pickup pencircle scaled 0.800000 pt;
  371      p := makepath makepen (-0.3492,0.9368)..(-0.3372,0.9414)
  372       ..(-0.3237,0.9456)..(-0.3085,0.9494)..(-0.2919,0.9527)
  373       ..(-0.2739,0.9557);
  374      drawarrow p scaled radius withcolor black;
  375      pickup pencircle scaled 0.400000 pt;
  376      pickup pencircle scaled 0.800000 pt;
  377      p := makepath makepen (-0.6147,0.7888)..(-0.6006,0.7990)
  378       ..(-0.5850,0.8089)..(-0.5678,0.8186)..(-0.5493,0.8279)
  379       ..(-0.5294,0.8370)..(-0.5083,0.8457)..(-0.4860,0.8543)
  380       ..(-0.4626,0.8625)..(-0.4383,0.8705)..(-0.4130,0.8783)
  381       ..(-0.3871,0.8858)..(-0.3605,0.8931)..(-0.3333,0.9002)
  382       ..(-0.3057,0.9070);
  383      drawarrow p scaled radius withcolor black;
  384      pickup pencircle scaled 0.400000 pt;
  385      pickup pencircle scaled 0.800000 pt;
  386      p := makepath makepen (-0.8776,0.4790)..(-0.8689,0.4947)
  387       ..(-0.8585,0.5102)..(-0.8464,0.5256)..(-0.8326,0.5409)
  388       ..(-0.8172,0.5559)..(-0.8002,0.5708)..(-0.7818,0.5855)
  389       ..(-0.7618,0.6002)..(-0.7407,0.6146)..(-0.7183,0.6290)
  390       ..(-0.6947,0.6432)..(-0.6700,0.6573)..(-0.6445,0.6712)
  391       ..(-0.6181,0.6851)..(-0.5909,0.6988)..(-0.5631,0.7124)
  392       ..(-0.5347,0.7259)..(-0.5060,0.7392)..(-0.4769,0.7523)
  393       ..(-0.4477,0.7654)..(-0.4184,0.7782)..(-0.3891,0.7909)
  394       ..(-0.3599,0.8034)..(-0.3312,0.8157)..(-0.3027,0.8278)
  395       ..(-0.2747,0.8397)..(-0.2474,0.8513)..(-0.2208,0.8627);
  396      drawarrow p scaled radius withcolor black;
  397      pickup pencircle scaled 0.400000 pt;
  398      pickup pencircle scaled 0.800000 pt;
  399      p := makepath makepen (-0.9977,0.0637)..(-0.9965,0.0819)
  400       ..(-0.9933,0.1002)..(-0.9883,0.1184)..(-0.9814,0.1366)
  401       ..(-0.9727,0.1547)..(-0.9622,0.1729)..(-0.9499,0.1912)
  402       ..(-0.9359,0.2094)..(-0.9202,0.2278)..(-0.9029,0.2461)
  403       ..(-0.8841,0.2644)..(-0.8638,0.2828)..(-0.8422,0.3012)
  404       ..(-0.8192,0.3198)..(-0.7950,0.3383)..(-0.7696,0.3570)
  405       ..(-0.7433,0.3755)..(-0.7160,0.3942)..(-0.6879,0.4130)
  406       ..(-0.6591,0.4317)..(-0.6296,0.4505)..(-0.5996,0.4693)
  407       ..(-0.5693,0.4882)..(-0.5386,0.5071)..(-0.5079,0.5258)
  408       ..(-0.4771,0.5446)..(-0.4462,0.5635)..(-0.4156,0.5821)
  409       ..(-0.3854,0.6007)..(-0.3554,0.6192)..(-0.3261,0.6376)
  410       ..(-0.2974,0.6559)..(-0.2694,0.6739)..(-0.2423,0.6918)
  411       ..(-0.2160,0.7096)..(-0.1909,0.7270)..(-0.1670,0.7441)
  412       ..(-0.1442,0.7611)..(-0.1227,0.7775)..(-0.1026,0.7938)
  413       ..(-0.0841,0.8095)..(-0.0670,0.8249)..(-0.0516,0.8398);
  414      drawarrow p scaled radius withcolor black;
  415      pickup pencircle scaled 0.400000 pt;
  416      pickup pencircle scaled 0.800000 pt;
  417      p := makepath makepen (-0.9312,-0.3643)..(-0.9374,-0.3473)
  418       ..(-0.9418,-0.3302)..(-0.9442,-0.3128)..(-0.9448,-0.2954)
  419       ..(-0.9435,-0.2777)..(-0.9403,-0.2599)..(-0.9351,-0.2420)
  420       ..(-0.9281,-0.2238)..(-0.9193,-0.2054)..(-0.9086,-0.1867)
  421       ..(-0.8962,-0.1678)..(-0.8820,-0.1487)..(-0.8660,-0.1294)
  422       ..(-0.8485,-0.1098)..(-0.8293,-0.0900)..(-0.8086,-0.0699)
  423       ..(-0.7865,-0.0495)..(-0.7630,-0.0289)..(-0.7382,-0.0080)
  424       ..(-0.7123,0.0130)..(-0.6852,0.0344)..(-0.6571,0.0560)
  425       ..(-0.6281,0.0779)..(-0.5983,0.1000)..(-0.5678,0.1224)
  426       ..(-0.5367,0.1449)..(-0.5052,0.1677)..(-0.4732,0.1906)
  427       ..(-0.4411,0.2138)..(-0.4088,0.2371)..(-0.3764,0.2606)
  428       ..(-0.3442,0.2841)..(-0.3122,0.3078)..(-0.2806,0.3316)
  429       ..(-0.2493,0.3553)..(-0.2186,0.3793)..(-0.1885,0.4031)
  430       ..(-0.1593,0.4269)..(-0.1309,0.4507)..(-0.1035,0.4744)
  431       ..(-0.0771,0.4980)..(-0.0519,0.5215)..(-0.0280,0.5448)
  432       ..(-0.0054,0.5678)..(0.0157,0.5906)..(0.0354,0.6132)
  433       ..(0.0536,0.6354)..(0.0701,0.6572)..(0.0849,0.6786)
  434       ..(0.0980,0.6996)..(0.1094,0.7201)..(0.1190,0.7401)
  435       ..(0.1267,0.7595)..(0.1326,0.7784)..(0.1366,0.7966)
  436       ..(0.1388,0.8141)..(0.1390,0.8309)..(0.1374,0.8470);
  437      drawarrow p scaled radius withcolor black;
  438      pickup pencircle scaled 0.400000 pt;
  439      pickup pencircle scaled 0.800000 pt;
  440      p := makepath makepen (-0.7069,-0.7073)..(-0.7185,-0.6949)
  441       ..(-0.7286,-0.6822)..(-0.7368,-0.6691)..(-0.7433,-0.6557)
  442       ..(-0.7479,-0.6420)..(-0.7506,-0.6280)..(-0.7515,-0.6135)
  443       ..(-0.7505,-0.5988)..(-0.7476,-0.5837)..(-0.7429,-0.5681)
  444       ..(-0.7362,-0.5522)..(-0.7277,-0.5358)..(-0.7173,-0.5191)
  445       ..(-0.7051,-0.5019)..(-0.6911,-0.4843)..(-0.6754,-0.4662)
  446       ..(-0.6581,-0.4476)..(-0.6390,-0.4286)..(-0.6185,-0.4091)
  447       ..(-0.5964,-0.3892)..(-0.5728,-0.3688)..(-0.5480,-0.3479)
  448       ..(-0.5219,-0.3266)..(-0.4946,-0.3047)..(-0.4662,-0.2824)
  449       ..(-0.4370,-0.2596)..(-0.4067,-0.2364)..(-0.3758,-0.2128)
  450       ..(-0.3441,-0.1887)..(-0.3119,-0.1641)..(-0.2793,-0.1391)
  451       ..(-0.2463,-0.1138)..(-0.2131,-0.0881)..(-0.1798,-0.0620)
  452       ..(-0.1465,-0.0356)..(-0.1133,-0.0087)..(-0.0805,0.0183)
  453       ..(-0.0479,0.0457)..(-0.0158,0.0733)..(0.0156,0.1011)
  454       ..(0.0464,0.1291)..(0.0764,0.1572)..(0.1055,0.1856)
  455       ..(0.1336,0.2140)..(0.1605,0.2424)..(0.1864,0.2708)
  456       ..(0.2109,0.2992)..(0.2340,0.3276)..(0.2558,0.3559)
  457       ..(0.2760,0.3840)..(0.2946,0.4120)..(0.3115,0.4398)
  458       ..(0.3269,0.4672)..(0.3404,0.4943)..(0.3522,0.5212)
  459       ..(0.3621,0.5476)..(0.3703,0.5736)..(0.3765,0.5990)
  460       ..(0.3809,0.6240)..(0.3834,0.6484)..(0.3841,0.6722)
  461       ..(0.3828,0.6953)..(0.3797,0.7177)..(0.3747,0.7394)
  462       ..(0.3680,0.7603)..(0.3594,0.7803)..(0.3492,0.7996)
  463       ..(0.3372,0.8179)..(0.3237,0.8353)..(0.3085,0.8517)
  464       ..(0.2919,0.8672)..(0.2739,0.8816);
  465      drawarrow p scaled radius withcolor black;
  466      pickup pencircle scaled 0.400000 pt;
  467      pickup pencircle scaled 0.800000 pt;
  468      p := makepath makepen (-0.4124,-0.9107)..(-0.4266,-0.9045)
  469       ..(-0.4391,-0.8979)..(-0.4500,-0.8908)..(-0.4592,-0.8834)
  470       ..(-0.4666,-0.8755)..(-0.4722,-0.8671)..(-0.4761,-0.8582)
  471       ..(-0.4780,-0.8489)..(-0.4781,-0.8390)..(-0.4762,-0.8286)
  472       ..(-0.4726,-0.8176)..(-0.4670,-0.8061)..(-0.4596,-0.7940)
  473       ..(-0.4502,-0.7813)..(-0.4392,-0.7679)..(-0.4263,-0.7540)
  474       ..(-0.4116,-0.7395)..(-0.3951,-0.7243)..(-0.3771,-0.7084)
  475       ..(-0.3574,-0.6919)..(-0.3362,-0.6748)..(-0.3135,-0.6569)
  476       ..(-0.2894,-0.6384)..(-0.2640,-0.6192)..(-0.2374,-0.5994)
  477       ..(-0.2097,-0.5788)..(-0.1809,-0.5576)..(-0.1511,-0.5357)
  478       ..(-0.1205,-0.5130)..(-0.0891,-0.4899)..(-0.0571,-0.4659)
  479       ..(-0.0247,-0.4414)..(0.0083,-0.4163)..(0.0415,-0.3905)
  480       ..(0.0749,-0.3642)..(0.1083,-0.3372)..(0.1418,-0.3097)
  481       ..(0.1749,-0.2817)..(0.2079,-0.2532)..(0.2404,-0.2242)
  482       ..(0.2726,-0.1947)..(0.3039,-0.1648)..(0.3347,-0.1345)
  483       ..(0.3645,-0.1038)..(0.3935,-0.0729)..(0.4214,-0.0417)
  484       ..(0.4482,-0.0102)..(0.4737,0.0216)..(0.4979,0.0534)
  485       ..(0.5208,0.0855)..(0.5422,0.1176)..(0.5621,0.1497)
  486       ..(0.5803,0.1818)..(0.5970,0.2138)..(0.6118,0.2459)
  487       ..(0.6250,0.2777)..(0.6363,0.3094)..(0.6458,0.3408)
  488       ..(0.6534,0.3719)..(0.6592,0.4028)..(0.6631,0.4332)
  489       ..(0.6651,0.4632)..(0.6652,0.4927)..(0.6634,0.5218)
  490       ..(0.6598,0.5502)..(0.6543,0.5780)..(0.6470,0.6052)
  491       ..(0.6379,0.6317)..(0.6272,0.6574)..(0.6147,0.6824)
  492       ..(0.6006,0.7065)..(0.5850,0.7298)..(0.5678,0.7522)
  493       ..(0.5493,0.7737)..(0.5294,0.7942)..(0.5083,0.8136)
  494       ..(0.4860,0.8321)..(0.4626,0.8495)..(0.4383,0.8658)
  495       ..(0.4130,0.8810)..(0.3871,0.8951)..(0.3605,0.9080)
  496       ..(0.3333,0.9197)..(0.3057,0.9303);
  497      drawarrow p scaled radius withcolor black;
  498      pickup pencircle scaled 0.400000 pt;
  499      pickup pencircle scaled 0.800000 pt;
  500      p := makepath makepen (-0.1994,-0.9798)..(-0.2052,-0.9776)
  501       ..(-0.2090,-0.9749)..(-0.2110,-0.9716)..(-0.2112,-0.9676)
  502       ..(-0.2095,-0.9630)..(-0.2058,-0.9577)..(-0.2004,-0.9516)
  503       ..(-0.1931,-0.9449)..(-0.1839,-0.9375)..(-0.1729,-0.9293)
  504       ..(-0.1602,-0.9203)..(-0.1456,-0.9105)..(-0.1294,-0.8999)
  505       ..(-0.1116,-0.8886)..(-0.0921,-0.8764)..(-0.0712,-0.8633)
  506       ..(-0.0488,-0.8495)..(-0.0251,-0.8347)..(0.0000,-0.8192)
  507       ..(0.0262,-0.8027)..(0.0536,-0.7854)..(0.0820,-0.7672)
  508       ..(0.1113,-0.7482)..(0.1415,-0.7283)..(0.1722,-0.7075)
  509       ..(0.2037,-0.6859)..(0.2356,-0.6635)..(0.2679,-0.6402)
  510       ..(0.3004,-0.6161)..(0.3332,-0.5913)..(0.3658,-0.5657)
  511       ..(0.3985,-0.5393)..(0.4309,-0.5121)..(0.4631,-0.4842)
  512       ..(0.4948,-0.4557)..(0.5259,-0.4265)..(0.5565,-0.3967)
  513       ..(0.5862,-0.3663)..(0.6151,-0.3353)..(0.6430,-0.3038)
  514       ..(0.6699,-0.2718)..(0.6955,-0.2393)..(0.7200,-0.2064)
  515       ..(0.7431,-0.1732)..(0.7649,-0.1396)..(0.7850,-0.1058)
  516       ..(0.8037,-0.0716)..(0.8207,-0.0373)..(0.8361,-0.0029)
  517       ..(0.8497,0.0317)..(0.8616,0.0662)..(0.8716,0.1008)
  518       ..(0.8798,0.1354)..(0.8862,0.1698)..(0.8906,0.2042)
  519       ..(0.8931,0.2383)..(0.8938,0.2721)..(0.8925,0.3057)
  520       ..(0.8894,0.3388)..(0.8844,0.3717)..(0.8776,0.4041)
  521       ..(0.8689,0.4360)..(0.8585,0.4673)..(0.8464,0.4981)
  522       ..(0.8326,0.5282)..(0.8172,0.5577)..(0.8002,0.5864)
  523       ..(0.7818,0.6144)..(0.7618,0.6416)..(0.7407,0.6679)
  524       ..(0.7183,0.6935)..(0.6947,0.7180)..(0.6700,0.7417)
  525       ..(0.6445,0.7644)..(0.6181,0.7861)..(0.5909,0.8068)
  526       ..(0.5631,0.8264);
  527      draw p scaled radius withcolor black;
  528      pickup pencircle scaled 0.800000 pt;
  529      p := makepath makepen (0.3312,0.9436)..(0.3027,0.9531)
  530       ..(0.2747,0.9614)..(0.2474,0.9686)..(0.2208,0.9746);
  531      drawarrow p scaled radius withcolor black;
  532      pickup pencircle scaled 0.400000 pt;
  533     ahangle:=oldahangle;
  534   %
  535   % Draw the $S_1$-, $S_2$- and $S_3$-axis of the Poincare sphere.
  536   % First of all, calculate the transformations of the intersections
  537   % for the unity sphere.
  538   %
  539   % Used variables:
  540   %
  541   %    behind_distance : Specifies the relative distance of the coordi-
  542   %                      axes to be plotted behind origo (in negative di-
  543   %                      rection of respective axis.
  544   %
  545   %   outside_distance_s1 : The relative distance from origo to the point
  546   %                         of the arrow head of the coordinate axis S1.
  547   %                         If this is set to 1.0, the arrow head will
  548   %                         point directly at the Poincare sphere.
  549   %
  550   %   outside_distance_s2 : Same as above, except that this one controls
  551   %                         the S2 coordinate axis instead.
  552   %
  553   %   outside_distance_s3 : Same as above, except that this one controls
  554   %                         the S3 coordinate axis instead.
  555   %
  556   %    insidecolval :    Specifies the shade of gray to use for the parts
  557   %                      of the coordinate axes that are inside the Poin-
  558   %                      care sphere. Values must be between 0 and 1,
  559   %                      where:  '0.0' <=> 'white';  '1.0' <=> 'black'
  560   %
  561      behind_distance_s1  := -0.300000;
  562      behind_distance_s2  := -0.300000;
  563      behind_distance_s3  := -0.300000;
  564      outside_distance_s1 :=  1.700000;
  565      outside_distance_s2 :=  2.400000;
  566      outside_distance_s3 :=  1.500000;
  567      insidecolval := .85;    % '0.0' <=> 'white';  '1.0' <=> 'black'
  568   
  569      pickup pencircle scaled 0.600000 pt;
  570   %
  571   % Start with drawing the x-axis...
  572   %
  573      x_bis_start :=  radius*behind_distance_s1*cosd(rot_psi)*cosd(rot_phi);
  574      y_bis_start :=  radius*behind_distance_s1*sind(rot_psi);
  575      z_bis_start := -radius*behind_distance_s1*cosd(rot_psi)*sind(rot_phi);
  576      x_bis_intersect :=  radius*cosd(rot_psi)*cosd(rot_phi);
  577      y_bis_intersect :=  radius*sind(rot_psi);
  578      z_bis_intersect := -radius*cosd(rot_psi)*sind(rot_phi);
  579      p := makepath makepen (y_bis_intersect,z_bis_intersect)--
  580                (outside_distance_s1*y_bis_intersect,
  581                 outside_distance_s1*z_bis_intersect);
  582      drawarrow p;
  583      label.bot(btex $s_1(t)$ etex,
  584                (outside_distance_s1*y_bis_intersect,
  585                 outside_distance_s1*z_bis_intersect));
  586   
  587   %
  588   % ... then draw the y-axis ...
  589   %
  590      x_bis_start := -radius*behind_distance_s2*sind(rot_psi)*cosd(rot_phi);
  591      y_bis_start :=  radius*behind_distance_s2*cosd(rot_psi);
  592      z_bis_start :=  radius*behind_distance_s2*sind(rot_psi)*sind(rot_phi);
  593      x_bis_intersect := -radius*sind(rot_psi)*cosd(rot_phi);
  594      y_bis_intersect :=  radius*cosd(rot_psi);
  595      z_bis_intersect :=  radius*sind(rot_psi)*sind(rot_phi);
  596      p := makepath makepen (y_bis_intersect,z_bis_intersect)--
  597                (outside_distance_s2*y_bis_intersect,
  598                 outside_distance_s2*z_bis_intersect);
  599      drawarrow p;
  600      label.bot(btex $s_2(t)$ etex,
  601                (outside_distance_s2*y_bis_intersect,
  602                 outside_distance_s2*z_bis_intersect));
  603   
  604   %
  605   % ... then, finally, draw the z-axis.
  606   %
  607      x_bis_start := radius*behind_distance_s3*sind(rot_phi);
  608      y_bis_start := 0.0;
  609      z_bis_start := radius*behind_distance_s3*cosd(rot_phi);
  610      x_bis_intersect := radius*sind(rot_phi);
  611      y_bis_intersect := 0.0;
  612      z_bis_intersect := radius*cosd(rot_phi);
  613      p := makepath makepen (y_bis_intersect,z_bis_intersect)--
  614                (outside_distance_s3*y_bis_intersect,
  615                 outside_distance_s3*z_bis_intersect);
  616      drawarrow p;
  617      label.urt(btex $s_3(t)$ etex,
  618                (outside_distance_s3*y_bis_intersect,
  619                 outside_distance_s3*z_bis_intersect));
  620   
  621      endfig;
  622   end
  623   

Return to previous page

Generated by ::viewsrc::

Last modified Wednesday 15 Feb 2023