home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / teach.zip / TEACH20A.ATF < prev    next >
Text File  |  1997-09-19  |  53KB  |  653 lines

  1. XNÉIO 0 1                                                                      °
  2. XNÉCT 0 1E²13                                                                  °
  3. XCÉFC 1 6 .,*0_²                                                               °
  4. XNÉRL 0 16807                                                                  °
  5. XCÉPR 1 1                                                                      °
  6. XCÉLX 1 5 TEACH                                                                °
  7. *(1996 4 6 16 11 2 220)                                                        °
  8.  FBIND ÉFX 'BIND' 'Σ Binding rules of APL2'                                    °
  9.   '''  1. Brackets bind to the left'''                                         °
  10.   '''  2. Left arrow binds to the left'''                                      °
  11.   '''  3. Dyadic operator binds to the right'''                                °
  12.   '''  4. Strand notation binding'''                                           °
  13.   '''  5. Operator binds to its left'''                                        °
  14.   '''  6. Function binds to its left'''                                        °
  15.   '''  7. Function binds to its right'''                                       °
  16. X '''  8. Left arrow binds to its right'',r'                                   °
  17. *(1997 8 21 13 4 39 408)                                                       °
  18.  FCALCULUS ÉFX 'CALCULUS' 'Σ Review of differentiation and integration'        °
  19.   '''Every polynomial, P(X), can be represented as a curve on a graph.''       °
  20.  '                                                                             °
  21.   '''This has been known since the French mathematician Renee Descartes'       °
  22.  ''                                                                            °
  23.   '''published an appendix called "La Geometrie" in his famous book'''         °
  24.   '''entitled "Discourse on Method". From this discovery in 1673,'''           °
  25.   '''evolved many branches of mathematics, particularly one called'''          °
  26.   '''Analytic Geometry.'',r'                                                   °
  27.   '''A CARTESIAN plot (named after Descartes) is a graph designed to'''        °
  28.   '''display data. It is represented by two straight lines drawn at righ       °
  29.  t''' '''angles on a graph paper.''' 'do' 'vec'                                °
  30.   '''The horizontal line is called the INDEPENDENT coordinate. It is als       °
  31.  o'''                                                                          °
  32.   '''called the ABSCISSA. The vertical line is the DEPENDENT variable,''       °
  33.  '                                                                             °
  34.   '''also known as the ORDINATE. Points to be plotted on this graph are'       °
  35.  ''                                                                            °
  36.   '''pairs of numbers, such as the rows of the N⌡2 array A shown on the'       °
  37.  '' '''graph'',r' 'show ''É╜A╜3 2µ.6 2 1 1 1.4 .5''' 'do'                      °
  38.   '''A polynomial P(X) can be drawn by plotting the number pairs (X,P(X)       °
  39.  ) on'''                                                                       °
  40.   '''such a graph. The mathematicians of the 17th century discovered tha       °
  41.  t'''                                                                          °
  42.   '''the slope of the graph (X,P(X)) at X can be calculated using a simp       °
  43.  le'''                                                                         °
  44.   '''formula. The formula consists of changing terms of the polynomial i       °
  45.  n''' '''the following way:'',r'                                               °
  46.   '''   1. multiply the coefficient by the power of X'''                       °
  47.   '''   2. reduce the power of X by 1'',r'                                     °
  48.   '''For example, the slope at any point X of the polynomial'',r'              °
  49.   '''     2X + 3XX + 5XXX'',r' '''is given by'',r'                             °
  50.   '''      2 + 6X + 15XX''' 'do'                                               °
  51.   '''Other mathematicians also discovered that the area under the polyno       °
  52.  mial''' '''P(X) can be calculated with another simple formula:'',r'           °
  53.   '''    1. Increase the power of each term by 1'''                            °
  54.   '''    2. Divide the coefficient by the new power'',r'                       °
  55.   '''Therefore the area under 2X + 3XX + 8XXX from 0 to X is given by'',       °
  56.  r' '''      XX + XXX + 2XXXX''' 'do'                                          °
  57.   '''It was the genius of Newton and Leibnitz to recognize these two'''        °
  58.   '''operations as duals of each other. Today, the process of finding th       °
  59.  e''' '''slope is called "taking the DERIVATIVE" and the process of'''         °
  60.   '''finding the area under a curve is called "INTEGRATION".'',r'              °
  61.   '''As we study primitive (and derived) APL2 functions, we may also'''        °
  62.   '''learn about their derivatives and integrals. These are subjects tha       °
  63.  t'''                                                                          °
  64.   '''are studied in DIFFERENTIAL (derivatives) and INTEGRAL CALCULUS.'''       °
  65.   'do'                                                                         °
  66.   '''Although it is not our intention to teach calculus here, there is''       °
  67.  ' '''one formula for finding derivatives that should be mentioned'',r'        °
  68.   ''' [1]    d(Y)/d(X) = d(Y)/d(Z) ⌡ d(Z)/d(X)'',r'                            °
  69.   '''To illustrate the usage of this formula, consider finding the'''          °
  70.   '''derivative of Y╜(1-X)*²1'',r'                                             °
  71.   '''Calling the term (1-X) temporarily Z, we have Y╜Z*²1. Then applying       °
  72.  ''' '''[1] we have'',r'                                                       °
  73.   '''     d(Y)/d(X) = (-Z*²2) ⌡ ²1         or'',r'                             °
  74. X '''               = (1-X)*²2'',r' 'endd'                                     °
  75. *(1997 8 21 13 6 16 324)                                                       °
  76. XFDEGREES ÉFX 'u╜DEGREES w' 'ΣDD' 'u╜180⌡w÷Ω1'                                 °
  77. *(1997 9 14 12 30 44 504)                                                      °
  78. XFDISCLAIMER ÉFX 'DISCLAIMER' 'Σ Copyright statement' 'disclaimer'             °
  79. *(1996 4 6 16 11 2 220)                                                        °
  80.  FDISPLAY ÉFX 'D╜S DISPLAY A;ÉIO;R;C;HL;HC;HT;HB;VL;VB;V;W;N;B'                °
  81.   'Σ DISPLAY A GENERAL ARRAY IN PICTORIAL FORM'                                °
  82.   'Σ  NORMAL CALL IS MONADIC.  DYADIC CALL USED ONLY IN'                       °
  83.   'Σ    RECURSION TO SPECIFY DISPLAY RANK, SHAPE, AND DEPTH.' 'ÉIO╜0'          °
  84.   '»(0=ÉNC ''S'')/''S╜µA''' 'R╜╞µ,S                   Σ PSEUDO RANK.'          °
  85.   'C╜''┐┌└┘''                 Σ UR, UL, LL, AND LR CORNERS.'                   °
  86.   'HL╜''─''                   Σ HORIZONTAL LINE.'                              °
  87.   'HC╜HL,''Θ╕'',HL,''~+ε''      Σ HORIZONTAL BORDERS.'                         °
  88.   'HT╜HC[(0<R)⌡1+0<╞²1╞,S]' 'ΣW╜,0╧■╞0µΓ(1⌐µA)╞A'                              °
  89.   'HB╜HC[3+3╛(''2⌡~A╧«A'' ÉEA ''1+╞ε0⌡(1⌐⌡/µA)╞,A'')+3⌡1<µµS]'                 °
  90.   'VL╜''│''                   Σ VERTICAL LINE.'                                °
  91.   'VB╜VL,''Φ╟''               Σ VERTICAL BORDER.'                              °
  92.   'V╜VB[(1<R)⌡1+0<²1╞²1╟,S]'                                                   °
  93.   '»(0εµA)/''A╜(1⌐µA)µΓ╞A''   Σ SHOW PROTOTYPE OF EMPTIES.'                    °
  94.   '╕(1<╧A)/GEN' '╕(2<µµA)/D3'                                                  °
  95.   'D╜«A                     Σ SIMPLE ARRAYS.' 'W╜1╞µD╜(²2╞1 1,µD)µD'           °
  96.   'N╜²1+1╟µD' '╕(0=µµA)/SS'                                                    °
  97.   'D╜(C[1],V,((W-1)µVL),C[2]),((HT,NµHL),[0]D,[0]HB,NµHL),C[0],(WµVL),C[       °
  98.  3]' '╕0' 'SS:HB╜((0 '' '')=╞0µΓA)/'' -'''                                     °
  99.   'D╜'' '',('' '',[0]D,[0]HB,Nµ'' ''),'' ''' '╕0'                              °
  100.   'GEN:D╜«DISPLAY■A          Σ ENCLOSED ...' 'N╜Dδ.⌠'' '''                     °
  101.   'D╜(Nδ~1ΦN)≡D' 'D╜(δ≡~''  ''╤D)/D' 'D╜((1,µS)µS)DISPLAY D'                   °
  102.   '╕(2≥µ,S)╟D3E,0' 'D3:D╜0 ²1╟0 1╟«ΓA         Σ MULT-DIMENSIONAL ...'          °
  103.   'W╜1╞µD' 'N╜²1+1╟µD'                                                         °
  104.   'D╜(C[1],V,((W-1)µVL),C[2]),((HT,NµHL),[0]D,[0]HB,NµHL),C[0],(WµVL),C[       °
  105.  3]' 'D3E:N╜²2+µ,S'                                                            °
  106. X 'V╜C[Nµ1],[0]VB[1+0<²2╟,S],[0](((²3+╞µD),N)µVL),[0]C[Nµ2]' 'D╜V,D'           °
  107. *(1996 4 6 16 11 2 220)                                                        °
  108.  FEXIT ÉFX 'EXIT' 'Σ Exit from function' '''To log off type:   )OFF'''         °
  109. X '╕'                                                                          °
  110. *(1997 8 21 13 5 51 460)                                                       °
  111. XFFOO ÉFX 'u╜FOO w' 'ΣDD' 'u╜+/w*0,∞20'                                        °
  112. *(1996 4 6 16 11 2 220)                                                        °
  113.  FGO ÉFX 'GO;T;E;B' 'Σ Expression driver' 'L0:B╜E╜''''' 'æ╜''      '''         °
  114.   'T╜æ' '╕(^/'' ''=T)/L0' '╕((^/'')OFF ''=5╞6╟T)doif ''EXIT'')/0'              °
  115.   '╕(('':''εT)doif ''B╜evaldd (+/^\'''' ''''=T)╟T'')/L0'                       °
  116.   '''E╜ÉEM'' ÉEA T' '╕(0=µ,E)/L0' '╕B/L0'                                      °
  117.   '''This is not a valid APL2 expression''' 'æ╜''*'''                          °
  118. X '╕(''?''⌠╞1╟æ)/L0' 'E' '╕L0'                                                 °
  119. *(1997 8 21 13 2 51 448)                                                       °
  120.  FHELP ÉFX 'HELP;N;I;T' 'Σ Help to student' '''WHAT TO DO'',r'                 °
  121.   '''  ° To get out of the lesson''' '''       ENTER: EXIT'''                  °
  122.   '''  ° To log off APL2'''                                                    °
  123.   '''       FIRST, ENTER: EXIT  THEN ENTER: )OFF'''                            °
  124.   '''  ° To get help''' '''       ENTER: HELP'''                               °
  125.   '''  ° When you see the prompt on a blank line'''                            °
  126.   '''       ENTER AN APL2 EXPRESSION - OR JUST PRESS: ENTER''' 'do'            °
  127.   '''  ° If you get this line'',r'                                             °
  128.   '''This is not a valid APL2 expression'',r,''*'',r'                          °
  129.   '''        YOU CAN EITHER''' '''           A. PRESS: ENTER'''                °
  130.   '''           B. PRESS: ? and then ENTER to see what was incorrect'''        °
  131.   '''              in your expression causing that response'',r' 'do'          °
  132.   '''HINTS'',r'                                                                °
  133.   '''This lesson is made up of '',(«N╜5),'' components named TEACHx, whe       °
  134.  re''' '''the x stands for a digit:'',r' 'I╜0'                                 °
  135.   'L0:T╜''TEACH'',(«I╜I+1)' 'T,'' '',1╟notb(ÉCR T)[2;]' '╕(N>I)/L0'            °
  136.   'do'                                                                         °
  137.   '''You may review either of these components separately. To do that,''       °
  138.  '                                                                             °
  139.   '''first enter EXIT (and RETURN), then enter the name of the lesson.''       °
  140.  ' '''component (e.g. TEACH4).'',r'                                            °
  141.   '''To re-start the lesson, just enter TEACH'',r'                             °
  142.   '''When the screen fills up, it is a good idea to move the cursor to''       °
  143.  ' '''the start of a convenient paragraph, and press ENTER'',r'                °
  144.   '''You may also wish to press PAGE UP to review the prevous pages.'''        °
  145.   'do' '''RESOURCES'',r'                                                       °
  146.   '''You may also enter ONE of the following words at a time'',r'              °
  147.   '''BIND      Listing of binding rules'''                                     °
  148. X '''CALCULUS  Differentiation and integration''' 'endd'                       °
  149. *(1997 8 21 13 5 48 448)                                                       °
  150. XFPASCAL ÉFX 'u╜PASCAL w' 'ΣDD' 'u╜(0,∞w)!w'                                   °
  151. *(1997 8 21 13 6 17 328)                                                       °
  152. XFRADIANS ÉFX 'u╜RADIANS w' 'ΣDD' 'u╜Ωw÷180'                                   °
  153. *(1997 9 5 12 8 6 228)                                                         °
  154.  FTEACH ÉFX 'TEACH' 'Σ Start lesson #20: APL2 by Zdenek V JIZBA'               °
  155.   'exit ''TEACH''' 'initialize'                                                °
  156.   'TEACH1 Σ Newton''s binomial expansion, analysis, infinite series'           °
  157.   'TEACH2 Σ Convergence of infinite series'                                    °
  158.   'TEACH3 Σ Measuring angles, degrees and radians'                             °
  159.   'TEACH4 Σ Theorems of Thales and Pythagoras; circular functions'             °
  160. X 'TEACH5 Σ Additional trigonometric functions' 'problems'                     °
  161. *(1997 7 19 12 10 57 488)                                                      °
  162.  FTEACH1 ÉFX 'TEACH1;T' 'Σ Review power function and logarithm'                °
  163.   'T╜ÉEX■''PASCAL'' ''FOO'''                                                   °
  164.   '''In the previous lesson we used the problem of interest rates to'''        °
  165.   '''study the power function, the logarithm, and even the factorial and       °
  166.  '''                                                                           °
  167.   '''binomial functions. We learned that a number can be raised to power       °
  168.  s''' '''that are not integers'',r' 'show ''5.67*3.21'''                       °
  169.   '''and we also learned that the factorial function works on numbers'''       °
  170.   '''other than integers, (when it is called the Gamma function)'',r'          °
  171.   'show ''!0.567'''                                                            °
  172.   '''We also defined a function to calculate the Pascal coefficients'''        °
  173.   '''for a polynomial of degree N'',r'                                         °
  174.   '1 show ''PASCAL:(0,∞∙)!∙'' ''PASCAL 6'''                                    °
  175.   '''These coefficients can also be calculated starting with the exponen       °
  176.  t''' '''of a polynomial such as (1 + X)*6'',r'                                °
  177.   '''1 + 6X + 15XX + 20XXX + 15XXXX + 6XXXXX + XXXXXX'',r'                     °
  178.   ''' 1. We begin with the 1'''                                                °
  179.   ''' 2. We then multiply 1⌡(6-0)÷1 to get 6'''                                °
  180.   ''' 3. Next we multiply 6⌡(6-1)÷2 to get 15'''                               °
  181.   ''' 4. We continue with 15⌡(6-2)÷3 to get 20'''                              °
  182.   ''' 5. And next 20⌡(6-3)÷4 to get 15'''                                      °
  183.   ''' 6. The next term is 15⌡(6-4)÷5 obtaining 6'''                            °
  184.   ''' 7. And finally 6⌡(6-5)÷6 for the final 1''' 'do'                         °
  185.   '''On June 13th 1676, Isaac Newton wrote a letter to Henry Oldenburg''       °
  186.  ' '''to be transmitted to Wilhelm Leibnitz. In this letter Newton'''          °
  187.   '''described his discovery years earlier that the rules for expanding'       °
  188.  ''                                                                            °
  189.   '''binomial powers apply to ALL NUMBERS N. This discovery eventually''       °
  190.  '                                                                             °
  191.   '''led to a new form of mathematics called ANALYSIS. It deals with'''        °
  192.   '''expansions that have no endings. These formulas are now called'''         °
  193.   '''INFINITE SERIES, and form an essential tool in modern mathematics.'       °
  194.  ',r'                                                                          °
  195.   '''Just as an illustration, consider the expansion of (1-X)*N when N=²       °
  196.  1'',r' ''' 1 (1⌡(²1-0)÷1) (²1⌡(²1-1)÷2) (1⌡(²1-2)÷3) ... or'',r'              °
  197.   ''' 1 ²1 1 ²1 ...'''                                                         °
  198.   '''but because the sign of X*K also alternates, we get 1÷1-X equals'',       °
  199.  r' ''' 1 + X + XX + XXX + XXXX +...'',r'                                      °
  200.   '''In APL2 we can form this expression as'',r'                               °
  201.   '1 show ''FOO:+/∙*0,∞20''' '''Here are some examples'',r'                    °
  202.   'show ''÷0.9'' ''FOO 0.1'' ''÷1.1'' ''FOO ²0.1'''                            °
  203.   '''At this point, if you have not been exposed to a math course called       °
  204.  '''                                                                           °
  205.   '''calculus, you may wish to enter CALCULUS for a short briefing.'''         °
  206. X 'endd'                                                                       °
  207. *(1997 7 19 12 15 13 332)                                                      °
  208.  FTEACH2 ÉFX 'TEACH2'                                                          °
  209.   'Σ Convergence, derivatives and integrals of infinite series'                °
  210.   '''You might have noticed that as X gets larger, the comparison betwee       °
  211.  n''' '''÷(1-X) and FOO X gets less accurate'',r'                              °
  212.   'show ''÷.6'' ''FOO .4'' ''÷.1'' ''FOO .9'''                                 °
  213.   '''This is because FOO evaluates only the first 20 terms of the series       °
  214.  '',r' '1 show ''FOO:'' ''+/1,.9*∞40'' ''+/1,.9*∞80'' ''+/1,.9*∞160'''         °
  215.   '''The RATE OF CONVERGENCE slows down, and finally when X is 1 or'''         °
  216.   '''greater, the summation no longer converges, but DIVERGES'',r'             °
  217.   'show ''÷²1'' ''FOO 2'' ''÷5'' ''FOO ²4'''                                   °
  218.   '''The problem of convergence and divergence of infinite series took''       °
  219.  '                                                                             °
  220.   '''250 years before it was adequately understood by mathematicians.'''       °
  221.   '''We mention it here, because it has bearing on APL2 algorithms.'''         °
  222.   'do'                                                                         °
  223.   '''Before we leave infinite series, consider the derivaive and the'''        °
  224.   '''integral of Y╜(1-X)*²1. The derivative is DY╜(1-X)*²2 and the'''          °
  225.   '''integral is IY╜╡(1-X). We can verify these relations by working'''        °
  226.   '''with the series'',r' '''  Y╜ 1 + X + XX + XXX + ...'',r'                  °
  227.   '''For the derivative, we have'',r'                                          °
  228.   '''  DY╜ 1 + 2X + 3XX + 4XXX + ...'',r'                                      °
  229.   '''and for the integral we have'',r'                                         °
  230.   '''  IY╜ X + (XX÷2) + (XXX÷3) + ...'',r'                                     °
  231.   '''With APL2 these expressions can be readily evaluated'',r'                 °
  232.   'show ''÷(.5)*2'' ''+/(∞25)⌡1,.5*∞24'''                                      °
  233.   'show ''╡.5'' ''-+/(÷∞35)⌡.5*∞35'''                                          °
  234.   '''This last example shows that transcendental functions can be expres       °
  235.  sed''' '''as infinite series. We will see more on that later on.'''           °
  236. X 'endd'                                                                       °
  237. *(1997 7 19 12 23 42 480)                                                      °
  238.  FTEACH3 ÉFX 'TEACH3;T' 'Σ Circle functions'                                   °
  239.   'T╜ÉEX■''DEGREES'' ''RADIANS''' '''MEASURING ANGLES'',r'                     °
  240.   '''So far whenever we discussed a variable such as X, it was inplicitl       °
  241.  y'''                                                                          °
  242.   '''assumed to be a quantity that increases in a "straight line" way'''       °
  243.   '''in the sense of a ruler measuring dimensions. The idea that a varia       °
  244.  ble'''                                                                        °
  245.   '''could also be thought of as measuring angles appears at first odd.'       °
  246.  ''                                                                            °
  247.   '''After all to measure angles we go "in circles" not in a straight'''       °
  248.   '''line. Historically, this seeming inconsistency did not arise, becau       °
  249.  se'''                                                                         °
  250.   '''the earliest angular measurements were made by astronomers. To them       °
  251.  '''                                                                           °
  252.   '''the separation between stars were merely distances, and not angles.       °
  253.  '''                                                                           °
  254.   '''On the other hand, dating as far back as ancient Mesopotamia, the a       °
  255.  ngles'''                                                                      °
  256.   '''of a circle were divided into 360 units, called DEGREES. Some of th       °
  257.  e'''                                                                          °
  258.   '''earliest tables dealing with angles were those of Ptolemy who sough       °
  259.  t''' '''to solve problems in SPHERICAL TRIGONOMETRY.''' 'do'                  °
  260.   '''One of the earliest problems tackled by Greek mathematicians was'''       °
  261.   '''the SQUARING OF THE CIRCLE. There were some ingenious attempts, but       °
  262.  '''                                                                           °
  263.   '''none produced a useful result. However in the third century BC'''         °
  264.   '''Archimedes succeeded in developing a method for approximating the a       °
  265.  rc'''                                                                         °
  266.   '''length of a circle. His method consisted of the measurement of the'       °
  267.  ''                                                                            °
  268.   '''perimeter of inscribed and circumscribed regular polygons. As the''       °
  269.  '                                                                             °
  270.   '''number of sides of the polygons increase, the two perimeters approa       °
  271.  ch''' '''that of the circular arc length.'',r'                                °
  272.   '''Another achievement along this line by Archimedes was a demonstrati       °
  273.  on'''                                                                         °
  274.   '''of the relation between the arc length of a circle, and the spiral'       °
  275.  '' '''that bears his name.'',r'                                               °
  276.   '''Historically, therefore, we have two distinct concepts for the'''         °
  277.   '''measurement of angles. On the practical level (engineering, astrono       °
  278.  my'''                                                                         °
  279.   '''etc), we measure angles in degrees, minutes and seconds. In theoret       °
  280.  ical'''                                                                       °
  281.   '''studies (mathematics, physics), angles are measured in units of arc       °
  282.  '''                                                                           °
  283.   '''length called RADIANS. A radian is defined to be the length of a'''       °
  284.   '''circular arc that has the same length as the radius of the circle.'       °
  285.  '' 'do'                                                                       °
  286.   '''Why do we mention all of this background? It is because most of us'       °
  287.  ''                                                                            °
  288.   '''learn to measure angles in degrees, minutes, and seconds, while'''        °
  289.   '''the APL2 primitive CIRCLE function deals with arc length in radians       °
  290.  .'',r' 'show ''Ω1'' ''Ω2'''                                                   °
  291.   '''The right argument to Ω is in units of half circle. In other words,       °
  292.  '''                                                                           °
  293.   '''the arc length of a circle spanning 180 degrees is the value given        °
  294.  by'''                                                                         °
  295.   '''Ω1. It also happens to be one of the most important constants of'''       °
  296.   '''mathematics, called PI.''' 'do'                                           °
  297.   '''We can define two functions: DEGREES and RADIANS, to convert from''       °
  298.  ' '''one of these units to the other'',r'                                     °
  299.   '1 show ''DEGREES:180⌡∙÷Ω1'' ''RADIANS:Ω∙÷180'''                             °
  300.   '''DEGREES returns radian argument in degrees and decimal fraction of'       °
  301.  '' '''degrees'',r' 'show ''DEGREES Ω.5'' ''DEGREES Ω÷3'''                     °
  302.   '''RADIANS returns a degree right argument in radians'',r'                   °
  303.   'show ''6⌡RADIANS 30'''                                                      °
  304.   '''As an exercise, you might try defining an APL2 function that would'       °
  305.  ''                                                                            °
  306.   '''convert radian measures to degrees, minutes and seconds. This funct       °
  307. Xion''' '''should work for an arbitrary numeric array!''' 'endd'               °
  308. *(1997 7 19 12 33 16 416)                                                      °
  309.  FTEACH4 ÉFX 'TEACH4' 'Σ Triangle functions' '''TRIANGLE FUNCTIONS'',r'        °
  310.   '''The earliest known proof of a mathematical theorem is one that'''         °
  311.   '''deals with geometrical figures. The Greek merchant, astronomer'''         °
  312.   '''and mathematician Thales of Miletus (640 - 546 BC) proved the'''          °
  313.   '''theorem of similar triangles that bears his name'',r' 'tri2'              °
  314.   '''In the two triangles, the inner angles are the same. By Thales'''''       °
  315.  '' '''theorem, the ratios are equal'',r'                                      °
  316.   '''      (oa÷OA)=(ob÷OB)=(ab÷AB)'',r' 'do'                                   °
  317.   '''Another important theorem of antiquity was that of Pythagoras'''          °
  318.   'tri'                                                                        °
  319.   '''The diagonal OB of a right angle triangle OAB is called the'''            °
  320.   '''HYPOTHENUSE. By the theorem of Pythagoras, the following relation''       °
  321.  ' '''holds:'',r,r,''     (OB*2)=(OA*2)+(AB*2)'',r' 'do'                       °
  322.   '''By convention, we can take the length OB=1, because by the theorem'       °
  323.  ''                                                                            °
  324.   '''of Thales we can always re-scale to an arbitrary sized triangle of'       °
  325.  '' '''the same "shape". Therefore, if OB=1, then OA<1 and AB<1 for'''         °
  326.   '''all right angle triangles. Given values [0≤X≤1] and [0≤Y≤1] for a''       °
  327.  ' '''right angle triangle, we have the constraint'',r'                        °
  328.   '''      1=+/(X,Y)*2'',r'                                                    °
  329.   '''We can use this equation to find Y, given X'',r'                          °
  330.   'show ''X╜.3'' ''Y╜(1-X*2)*0.5'' ''Y'''                                      °
  331.   '''There is a dyadic APL2 primitive to do this'',r'                          °
  332.   'show ''0ΩX'' ''0Ω0ΩX '''                                                    °
  333.   '''From the last expression it is clear that 0ΩX is its own dual.'''         °
  334.   '''It is also clear that the argument to 0Ω should be in the range'''        °
  335.   '''0≤X≤1. For values outside this range the formula (1-X*2)*.5 will'''       °
  336.   '''produce the square root of a negative number.'''                          °
  337.   'show ''X╜2'' ''(1-X*2)*.5'' ''0ΩX''' 'do'                                   °
  338.   '''Let us look again at a right angle triangle'',r' 'tri'                    °
  339.   '''Since the length of the hypotenuse is 1, only one other quantity'''       °
  340.   '''is sufficient to fully specify the right angle triangle. We have'''       °
  341.   '''already seen that knowing AB we can determine OA using the dyadic''       °
  342.  '                                                                             °
  343.   '''0Ω primitive. We can also determine the triangle knowing the arc'''       °
  344.   '''length α. Given α we can obtain AB using another dyadic circular'''       °
  345.   '''function, namely 1Ω'',r' 'show ''1Ω1'''                                   °
  346.   '''The right argument in the above expression MUST BE in radians. The'       °
  347.  ''                                                                            °
  348.   '''value returned is the height of the side opposite to the angle α.''       °
  349.  '                                                                             °
  350.   '''This function is called the SINE function. It is a PERIODIC one,'''       °
  351.   '''because an angle measures the amount of rotation'',r'                     °
  352.   'show ''1ΩRADIANS 30'' ''1ΩRADIANS 390'' ''1ΩRADIANS 750'''                  °
  353.   '''Rotations greater than 360 are equivalent to rotations of the'''          °
  354.   '''residue after dividing by 360'',r' 'show ''360|30 390 750'''              °
  355.   '''By convention, positive rotation is counter clockwise starting from       °
  356.  '''                                                                           °
  357.   '''the direction of the positive X axis. Counter clockwise rotation'''       °
  358.   '''is represented by negative numbers'',r'                                   °
  359.   'show ''1ΩRADIANS ²330 ²690 ²1050''' '''since'',r'                           °
  360.   'show ''360|²330 ²690 ²1050'''                                               °
  361.   '''(The word "sine" appears to have been used first around the 14th'''       °
  362.   '''century as a mis-translation of an Arabic word to "sinus" meaning''       °
  363. X' '''gulf.)''' 'endd'                                                         °
  364. *(1997 7 21 14 20 3 328)                                                       °
  365.  FTEACH5 ÉFX 'TEACH5;X;Y;i' 'Σ More trig functions'                            °
  366.   '''Since only one measurement is needed to specify a right angle'''          °
  367.   '''triangle with unit hypothenuse, then given α, the angle opposite'''       °
  368.   '''to side AB is also determined. This angle is called the COMPLEMENTA       °
  369.  RY'''                                                                         °
  370.   '''angle (or CO-angle). For every primitive function defined on α, the       °
  371.  re'''                                                                         °
  372.   '''is a CO-function defined for the complementary angle. The side OA i       °
  373.  s'''                                                                          °
  374.   '''the sine of the CO-angle of α, and therefore it is also known as th       °
  375.  e'''                                                                          °
  376.   '''COSINE of α. The APL2 primitive dyadic circle function for the cosi       °
  377.  ne''' '''is given by 2Ω'',r'                                                  °
  378.   'show ''2ΩRADIANS 30'' ''0Ω2ΩRADIANS 30'''                                   °
  379.   '''It should be pointed out here that both the left and the right'''         °
  380.   '''arguments of a circle function can be vectors or arrays'',r'              °
  381.   'show ''1 2ΩRADIANS 30 90'' ''(2 2µ1 2 2 1)ΩRADIANS 30'''                    °
  382.   'show ''1ΩRADIANS É╜30+2 2µ0 90 ²90 0''' 'tri'                               °
  383.   '''So far we have developed functions to calculate OA from AB, AB from       °
  384.  '''                                                                           °
  385.   '''OA, AB from α and OA from α. To complete the pattern, we need a'''        °
  386.   '''function to return α given AB or OA. Since such functions are duals       °
  387.  '''                                                                           °
  388.   '''of SINE and COSINE, their names are related, and in fact are ARC SI       °
  389.  NE'''                                                                         °
  390.   '''and ARC COSINE. The APL2 expression is also related, namely ²1Ω and       °
  391.  ''' '''²2Ω'',r' 'show ''DEGREES ²1 ²2Ω1 2ΩRADIANS 25 65'''                    °
  392.   '''When the angle is 0 or an integral multiple of 90 degrees, the'''         °
  393.   '''triangle degenerates into a horizontal or vertical straight line.''       °
  394.  ' '''Despite this, the circle functions still return values'',r'              °
  395.   'show ''1Ω0'' ''²1Ω0'''                                                      °
  396.   '''The sine of 0 and arc-sine of zero represent the limiting value of'       °
  397.  '' '''the line AB and the angle α as the triangle becomes a single'''         °
  398.   '''horizontal line. The cosine and arc-cosine return respectively the'       °
  399.  '' '''unit radius, and the arc'',r' 'show ''2Ω0'' ''²2Ω1'''                   °
  400.   '''When α approaches 90 degrees, the triangle degenerates into a verti       °
  401.  cal''' '''line'',r' 'show ''1 2ΩΩ.5'' ''DEGREES ²1 ²2Ω1 0'''                  °
  402.   '''Consider now the following figure'',r' 'tan'                              °
  403.   '''The line OB is the same length as OC. Therefore, since the circle''       °
  404.  ' '''passes through point C, the line CD is tangent to the circle.'''         °
  405.   'do'                                                                         °
  406.   '''We can find the length of CD by applying the theorem of Thales'',r'       °
  407.   '''       (AB÷OA)=CD÷OC'',r' '''Since OC=1, we therefore have'',r'           °
  408.   '''        CD=(tan α)=(sin α)÷cos α'',r'                                     °
  409.   '''The TANGENT is another important circle function, and in APL2 it'''       °
  410.   '''is defined by 3Ω. Not surprisingly ²3Ω is called ARC TANGENT'',r'         °
  411.   'show ''3ΩRADIANS 45'' ''DEGREES ²3Ω1'''                                     °
  412.   '''The COTANGENT of α naturally is given by (cos α)÷(sin α).''' 'do'         °
  413.   '''Finally, on the same figure we could also define the length OD'''         °
  414.   '''Again by the theorem of Thales we have'',r'                               °
  415.   '''      (OB÷OA)=(OD÷OC)'',r'                                                °
  416.   '''The quantity OC is called SECANT, and by replacing OB and OA, we'''       °
  417.   '''have'',r' '''         (sec α)=1÷cos α'',r'                                °
  418.   '''Since this quantity is so readily obtained using 2Ω, it has not'''        °
  419.   '''been defined by a primitive APL2 function. (The CO-angle function''       °
  420.  ' '''of secant is natually called COSECANT.)''' 'do'                          °
  421.   '''     OTHER CIRCULAR FUNCTIONS'',r'                                        °
  422.   '''APL2 does not stop at 3Ω. There are additional circle functions,'''       °
  423.   '''but here we will merely mention them. Circle functions 4 5 6 7,'''        °
  424.   '''and ²4 ²5 ²6 ²7 are associated with properties of the HYPERBOLA.'''       °
  425.   '''These are analogous to those of circular functions. To wit, 4Ω is''       °
  426.  ' '''the hyperbolic equivalent of 0Ω and is given by'',r'                     °
  427.   'show ''X╜.6'' ''(1+X*2)*.5'' ''É╜Y╜4ΩX'''                                   °
  428.   '''The formula for ²4Ω is'',r' 'show ''(²1+Y*2)*.5'' ''²4ΩY'''               °
  429.   '''5Ω and ²5Ω are called HYPERBOLIC SINE and HYPERBOLIC ARC SINE'''          °
  430.   '''6Ω and 7Ω follow the same pattern. 6Ω is the HYPERBOLIC COSINE'''         °
  431.   '''and 7Ω is the HYPERBOLIC TANGENT. We will not pursue here these'''        °
  432.   '''specialized functions.''' 'do'                                            °
  433.   '''Circle functions 8 9 10 11 12, and ²8 ²9 ²10 ²11 ²12 deal with'''         °
  434.   '''complex numbers. The result of 8ΩX will depend on whether X is'''         °
  435.   '''greater than zero. If X less than 0, then 8ΩX  will return the'''         °
  436.   '''quantity (²1-X*2)*.5. If X is zero or greater, 8ΩX will return the'       °
  437.  ''                                                                            °
  438.   '''negative of this expression. The expression ²8ΩX returns the 8ΩX'''       °
  439.   '''with signs on both the real and imaginary components reversed.'',r'       °
  440.   'show ''8Ω5J1 .5J1'' ''²8Ω5J1 .5J1'''                                        °
  441.   '''Here is a listing of the remaining cicular functions'',r'                 °
  442.   '''  EXPRESSION     RETURNS'''                                               °
  443.   '''    9ΩX          Real component of X''' '''   ²9ΩX          X'''          °
  444.   '''   10ΩX          Absolute value of X'''                                   °
  445.   '''  ²10ΩX          Complex conjugate of X'''                                °
  446.   '''   11ΩX          Imaginary component of X'''                              °
  447.   '''  ²11ΩX          X multiplied by 0J1'''                                   °
  448.   '''   12ΩX          Phase of X'''                                            °
  449.   '''  ²12ΩX          Exponential of X times 0J1'',r'                          °
  450.   'show ''X╜1J2'' ''(4 2µ9 ²9 10 ²10 11 ²11 12 ²12)ΩX'''                       °
  451.   'show ''(X⌡²10ΩX)*.5'' ''(X⌡+X)*.5'' ''10ΩX'''                               °
  452. X 'show ''i╜0J1'' ''*i⌡X'' ''²12ΩX''' 'endd'                                   °
  453. *(1996 4 6 16 11 3 224)                                                        °
  454.  FTIME ÉFX 'U╜V TIME W;T' 'Σ Measure execution time of W'                      °
  455. X 'U╜60 60 1000¥²3╞ÉTS' 'T╜»■VµΓW' 'U╜(,-U-60 60 1000¥²3╞ÉTS)÷V'               °
  456. XNX 0 2                                                                        °
  457. XNY 0 0.9539392014169457                                                       °
  458. *(1997 7 13 12 28 49 504)                                                      °
  459.  Faddquote ÉFX 'u╜addquote w'                                                  °
  460.   'Σ Put quotes around a string, and double existing quotes'                   °
  461. X 'u╜ÉAV[40],((1+w=ÉAV[40])/w),ÉAV[40]'                                        °
  462. *(1996 4 6 16 11 3 224)                                                        °
  463. XFaq ÉFX 'U╜aq W' 'U╜Γaddquote W'                                              °
  464. *(1997 7 24 13 20 38 476)                                                      °
  465.  Fav ÉFX 'av;A;N;I;ÉIO' 'Σ Display characters in ÉAV' 'ÉIO╜0'                  °
  466.   'A╜22 78µ'' ''' 'N╜3 0«φ12 22µ1+∞356' 'A[;,(6⌡∞12)°.+2 3 4]╜N'               °
  467.   'A[;6+6⌡∞12]╜φ12 22µÉAV' 'ΣA[8 10 13;6]╜'' ''' 'A[13;6]╜'' '''               °
  468. X 'A[14+∞8;68 69 70 72]╜'' ''' 'A'                                             °
  469. *(1991 11 11 8 25 13 316)                                                      °
  470.  Fdate ÉFX 'u╜date w' 'Σ Format date and time of day' 'u╜«6╞w'                 °
  471. X 'u╜('' ''⌠u)Γu' 'u╜εu,■''-- .. '''                                           °
  472. XCdig 1 10 1234567890                                                          °
  473. *(1997 9 9 13 0 45 372)                                                        °
  474.  Fdisclaimer ÉFX 'disclaimer' 'Σ Copyright statement'                          °
  475.   '(10µ'' ''),''Copyright, Z. V. Jizba, 1995,1996,1997'',r'                    °
  476.   ''' This and subsequent workspaces labelled TEACHxx are made available       °
  477.  '''                                                                           °
  478.   '''at no cost to anyone who desires to learn how to use effectively'''       °
  479.   '''the IBM/OS2 version of APL2.'',r'                                         °
  480.   '''This software is provided "AS IS" with no WARRANTY of any kind, eit       °
  481.  her'''                                                                        °
  482.   '''express or implied. Any risk in its use resides with you, the user        °
  483.  of''' '''these tutorials.'',r' '''     ACKNOWLEDGEMENTS'',r'                  °
  484.   ''' In writing these tutorials, I am greatly indebted to Roy Sykes, wh       °
  485.  ose'''                                                                        °
  486.   '''excellent lectures increased my understanding of the language.'''         °
  487.   '''Discussions with the late Harry Bertucelli clarified a number of'''       °
  488.   '''concepts and caused me to change some improper terminology that was       °
  489.  '''                                                                           °
  490.   '''used in previous versions of these tutorials. Mr. Benjamin Archer''       °
  491.  '                                                                             °
  492.   '''kindly checked out a nearly final version, bringing to my attention       °
  493.  ''' '''some ommisions, misspellings, and invalid terminology.'',r'            °
  494. X '''(PRESS ENTER to continue)'''                                              °
  495. *(1997 7 13 12 28 50 508)                                                      °
  496.  Fdo ÉFX 'do;T;E' 'Σ Expression driver' 'E╜''''' 'æ╜''      ''' 'T╜æ'          °
  497.   '╕(^/'' ''=T)/0'                                                             °
  498.   '╕(('':''εT)doif ''B╜evaldd (+/^\'''' ''''=T)╟T'')/2'                        °
  499.   '''E╜ÉEM'' ÉEA T' '╕(0=µ,E)/2'                                               °
  500.   '''This is not a valid APL2 expression''' 'æ╜''*''' '╕(''?''⌠╞1╟æ)/2'        °
  501. X 'E' '╕2'                                                                     °
  502. *(1997 7 13 12 28 50 508)                                                      °
  503.  Fdoif ÉFX 'U╢╜V╢ doif W╢;t╢' 'Σ Rule' '╕(^/~U╢╜V╢)/0'                         °
  504. X '''U╢╜V╢ doif■ W╢'' ÉEA ''»V╢/W╢'''                                          °
  505. *(1997 9 9 12 50 14 444)                                                       °
  506.  Fendd ÉFX 'endd' 'Σ end of special feature' '20µ''²'' ╪ ╕(4<µÉLC)/0'          °
  507. X 'do'                                                                         °
  508. *(1997 8 21 13 0 55 456)                                                       °
  509.  Ferase ÉFX                                                                    °
  510.   'erase;t;EXIT;GO;HELP;DISPLAY;BIND;TIME;CALCULUS;tri2;DISCLAIMER'            °
  511.   'Σ Erase all global functions and variables' 't╜ÉNL 3'                       °
  512.   't╜(~t^.εlc,'' '')≡t' 't╜ÉEX(~t[;∞5]^.=''TEACH'')≡t' 't╜ÉNL 2'               °
  513. X 't╜ÉEX(~t^.εlc,'' '')≡t' 't╜ÉNL 4' 't╜ÉEX(~t^.εlc,'' '')≡t'                  °
  514. *(1997 7 27 13 47 41 608)                                                      °
  515.  Fevaldd ÉFX 'u╜evaldd w;c;n' 'Σ Evaluate direct definition' 'u╜0'             °
  516.   'n╜(w∞''Σ'')-1' 'c╜(((n╞w)⌠'':'')Γn╞w),Γ''ΣDD '',(n+1)╟w'                    °
  517.   '╕((1 label╞c)doif ''''''Invalid label'''''')/0'                             °
  518.   '╕((2=µc)doif ''u╜showdd 1╙c'')/0'                                           °
  519.   '╕((3=ÉNC╞c)doif ''u╜⌡µÉ╜(╞c),'''' is already defined.'''''')/0'             °
  520.   '╕((3=µc)doif ''u╜simdd c'')/0' 'c╜(Γ''α∙ aw'')replace■c'                    °
  521.   'u╜ε''u╜'',((''a''εεc[2 3 4])/''a ''),(╞c),'' w;t;b'''                       °
  522.   'u╜u(5πc)(''b╜(t╜'',(3πc),'')/'',addquote ''u╜'',4πc)'                       °
  523. X 'u╜u,''╕(t doif b)/0''(''u╜'',2πc)' 'u╜╧ÉFX u'                               °
  524. *(1997 7 25 13 27 52 564)                                                      °
  525.  Fexit ÉFX 'V exit W;T' 'Σ Exit if too many suspended functions'               °
  526.   '╕(0⌠ÉNC ''V'')/L0 ╪ V╜10' 'L0:╕(V>µÉLC)/0'                                  °
  527.   '''There are too many suspended functions''' '''Please enter '',W'           °
  528. X '╕'                                                                          °
  529. *(1997 7 26 12 33 39 536)                                                      °
  530.  Fget ÉFX 'U╜V get W;t;T;ÉPR' 'Σ Prompt for response from keyboard'            °
  531.   'ÉPR╜T╜ÉAV[ÉIO+255] ╪ ╕(0⌠ÉNC ''V'')/L0 ╪ V╜1' 'L0:V╜V╧1' 'æ╜W ╪ t╜æ'        °
  532.   'U╜(+/^\t=T)╟t' '╕(''╕''⌠╞U)/L1 ╪ ╕' 'L1:╕V/0' 't╜(U⌠'' '')ΓU'               °
  533. X 'U╜(µt),(ΓU),t'                                                              °
  534. *(1997 7 28 13 33 8 424)                                                       °
  535.  Fglobals ÉFX 'globals' 'Σ Initialize useful global variables'                 °
  536.   'uc╜''ABCDEFGHIJKLMNOPQRSTUVWXYZ'''                                          °
  537.   'lc╜''abcdefghijklmnopqrstuvwxyz''' 'dig╜''1234567890'''                     °
  538. X 'r╜ÉAV[13+ÉIO]' 'q╜'''''''''                                                 °
  539. *(1997 7 3 12 47 6 368)                                                        °
  540.  Finitialize ÉFX 'initialize;T' 'Σ Initialize workspace'                       °
  541.   '''AT ALL TIMES, TO CONTINUE, PRESS RETURN!'',r'                             °
  542.   '''To see disclaimers enter:'',r,''    disclaimer''' 'do' 'erase'            °
  543.   'globals'                                                                    °
  544.   '''Make sure the CAP LOCK light on your keyboard (upper right) is ON!'       °
  545. X'' 'endd'                                                                     °
  546. *(1997 7 27 13 14 33 444)                                                      °
  547.  Flabel ÉFX 'u╜v label w'                                                      °
  548.   'Σ Return 1 if label w does not begin with a cap'                            °
  549.   '╕(0⌠ÉNC ''v'')/L0 ╪ v╜0' 'L0:v╜v╧1 ╪ w╜εw ╪ ╕v/L1 ╪ ╕(u╜0⌠ÉNC w)/0'         °
  550. X 'L1:╕(u╜~^/wεlc,uc,dig)/0' 'u╜w[1]εlc,dig'                                   °
  551. XClc 1 26 abcdefghijklmnopqrstuvwxyz                                           °
  552. *(1997 7 13 12 28 55 528)                                                      °
  553.  Fnon ÉFX 'non;T;RC;ET;R' 'Σ Ignore keyboard entry' 'æ╜''      ''' 'T╜æ'       °
  554.   '╕(0=µ(T⌠'' '')/T)/0' '(RC ET R)╜ÉEC T' '╕(0=RC)/2'                          °
  555. X '╕((1=RC)doif ''R'')/2' '╕2'                                                 °
  556. *(1997 7 13 12 28 55 528)                                                      °
  557.  Fnotb ÉFX 'u╜notb w' 'Σ Remove trailing blanks'                               °
  558.   '╕((1<╧w)doif ''u╜notb■ w'')/0' '╕((1<µµw)doif ''u╜πnotb Γ[2]w'')/0'         °
  559. X 'u╜(1-(,'' ''⌠Φw)∞1)╟w'                                                      °
  560. *(1996 4 6 16 11 3 224)                                                        °
  561.  Fpause ÉFX 'V pause W;T'                                                      °
  562.   'Σ Pause, then print W V spaces right and return'                            °
  563. X 'T╜(0=ÉNC ''V'')doif ''V╜6''' 'do' '(Vµ'' ''),W' 'do'                        °
  564. *(1997 7 27 12 55 6 496)                                                       °
  565.  Fproblems ÉFX 'problems' 'Σ Problems'                                         °
  566.   '''That is all for this lesson. Remember, if you want to practice,'''        °
  567.   '''and plan to use direct definitions, be sure to first enter GO.'''         °
  568.   '''Direct definitions will then be accepted. To exit GO, enter EXIT.''       °
  569.  ,r'                                                                           °
  570.   '''To erase a previously defined DIRECT DEFINITION FUNCTION, enter'',r       °
  571.  ' '''       )ERASE functionname'',r'                                          °
  572. X '''WARNING! do not use )ERASE on other labels.'',r'                          °
  573. XCq 0 '                                                                        °
  574. XCr 0                                                                         °
  575. *(1997 7 13 12 28 56 532)                                                      °
  576.  Freplace ÉFX 'u╜v replace u;i;r;s' 'Σ Replace elements in v in u'             °
  577.   'i╜Γ∞µu' 's╜2πv╜(v⌠'' '')Γv' 'i╜⌡r╜i⌡■Γ[1]u°.=╞v'                            °
  578. X 'u[(εi)/εr]╜s[(εi)/εi⌡■∞µs]'                                                 °
  579. *(1997 7 13 12 28 56 532)                                                      °
  580.  Fround ÉFX 'U╜V round W' 'Σ Half adjust to V th decimal'                      °
  581. X 'U╜(╛0.5+W⌡10*V)÷10*V'                                                       °
  582. *(1997 7 13 12 28 57 536)                                                      °
  583.  Fshow ÉFX '╢V show ╢W;╢T;╢B' 'Σ Display and execute ╢W'                       °
  584.   '╢T╜(0=ÉNC ''╢V'')doif ''╢V╜0'''                                             °
  585.   '╕((0=╧╢W)doif ''show ╢W,'''' '''''')/0'                                     °
  586.   '╕((1<╧╢W)doif ''╢V show ■╢W'')/0' '''      '',╢W'                           °
  587. X '╕((╢V^'':''ε╢W)doif ''╢T╜evaldd ╢W'')/L0' '''ÉEM'' ÉEA ╢W' 'L0:do'          °
  588. *(1997 7 13 12 28 57 536)                                                      °
  589.  Fshowdd ÉFX 'u╜showdd w;a;b;c;r'                                              °
  590.   'Σ Display a direct definition function'                                     °
  591.   '╕((1=╧w)doif ''u╜showdd Γw'')/u╜0'                                          °
  592.   '╕((3⌠ÉNC╞w)doif ''(ε╞w),'''' is not a function'''''')/0'                    °
  593.   'c╜Γ[2]ÉCR╞w' 'c╜notb(2╞c),(Γ''aw α∙'')replace■2╟c'                          °
  594.   '╕((~''ΣDD''╧3╞2πc)doif ''''''Not a direct definition function'''''')/       °
  595.  0' 'u╜1' 'b╜('' ''⌠╞c)Γ╞c' 'a╜''      ''' 'r╜2╟3πc'                           °
  596.   '╕((3=µc)doif ''a,(╞w),'''':'''',r,(3<µ2πc)/''''   Σ'''',3╟2πc'')/0'         °
  597.   'a╜a,(╞w),'':'',(2╟5πc),'':''' 'b╜(+\r=''('')-+\r='')''' 'b╜b∞0'             °
  598. X 'a╜a,(²3╟(b-1)╞3╟r),'':'',2╟»(b+2)╟r' 'a,(3<µ2πc)/''  Σ'',3╟2πc'             °
  599. *(1997 7 13 12 28 57 536)                                                      °
  600.  Fshowfn ÉFX 'U╜V showfn W;F;N;T;ÉIO' 'Σ Simulate ╖W[É]'                       °
  601.   'T╜(0=ÉNC ''V'')doif ''V╜0''' 'ÉIO╜0'                                        °
  602.   'U╜r,''      '',''╖'',W,''[É]'',(╞V)╞''╖''' 'N╜1╞µF╜ÉCR W' 'N╜«∞N'           °
  603.   'N╜(N⌠'' '')ΓN' 'F╜(π''['',■N,■Γ''] ''),F'                                   °
  604.   'T╜(1<µ,V)doif ''F╜F[1╟V;]'' ''U╜''''''''''' 'U╜²1╟U,r,,F,r'                 °
  605. X 'U╜((-+/^\'' ''=ΦU)╟U),('' ╖'')[╞V],r'                                       °
  606. *(1997 7 13 12 28 58 540)                                                      °
  607.  Fsimdd ÉFX 'u╜simdd w;e' 'Σ Direct definition mode' 'u╜0'                     °
  608.   '╕((0⌠ÉNC╞w)doif ''''''Already defined'''''')/0' 'e╜''α''ε2πw'               °
  609.   'w[2]╜Γ''u╜'',''α∙ aw'' replace 2πw' 'w╜w[1 3 2]'                            °
  610. X 'w[1]╜Γε''u╜'',(e/''a ''),w[1],'' w''' 'u╜╧ÉFX w'                            °
  611. *(1992 6 3 9 59 17 424)                                                        °
  612.  Ftab ÉFX 'U╜V tab W;T;A;B;C;D;E;F;G;M;ÉPW' 'Σ Tabulate list W'                °
  613.   'T╜(0=ÉNC ''V'')doif ''V╜0''' 'M╜''Invalid data for tabulation'''            °
  614.   'V╜4╞V' 'ÉPW╜130╛30⌐G╜V[2]+79⌡V[2]=0'                                        °
  615.   'L1:╕((1<╧W)doif ''''''W╜∞0'''' ÉEA ''''W╜πW'''''')/L1'                      °
  616.   '╕(((0=µεW)δ2<µµW)doif ''U╜(~V╧4╞0)/M'')/0'                                  °
  617.   'T╜(1≥µµU╜«W)doif ''U╜πW╜(U⌠'''' '''')ΓU'''                                  °
  618.   'T╜(0<V[1])doif ''U╜(«(Φ1,╞µW)µ(V[3]µ'''' ''''),∞(╞µW)-V[3]),'''' ''''       °
  619.  ,U''' '╕(G<30)/0' 'T╜(F╜µεV[4])+C╜1╟B╜µA╜(V[3],0)╟U'                          °
  620.   'T╜⌐(1╞B)÷1⌐╛(ÉPW+F)÷T' 'U╜(E╜(V[3],C)╞U),[1](B╜T,1╟B)╞A'                    °
  621.   '''D╜εV[4]'' ÉEA ''D╜ÉAV[εV[4]+33⌡V[4]=0]''' 'L0:A╜(T,0)╟A'                  °
  622. X '╕(0=1╞µA)/0' 'U╜U,(((T+V[3]),µD)µD),E,[1]B╞A' '╕L0'                         °
  623. *(1996 4 6 16 11 3 224)                                                        °
  624.  Ftan ÉFX 'U╜tan' 'Σ Draw 2d vector in plane'                                  °
  625.   'U╜r,''                D'',r' 'U╜U,''              / |'',r'                  °
  626.   'U╜U,''          B /   |'',r'                                                °
  627.   'U╜U,''          /|    |'',r ''       /  |    |'',r,''      /    |           °
  628.  |'',r'                                                                        °
  629.   'U╜U,''    /      |    |'',r,''  / α      |    |'',r,''O²²²²²²²²²²A²²²       °
  630. X²C'',r'                                                                       °
  631. *(1997 7 13 12 28 59 544)                                                      °
  632.  Ftest ÉFX 'U╜V test W;P'                                                      °
  633.   'Σ Describe problem in W, (correct answer in V)' 'U╜2' 'L1:W'                °
  634.   'É╜''      ''' 'P╜æ' '''╕L0'' ÉEA ''P╜»P''' '╕(V╧P)/0'                       °
  635. X 'L0:╕(0=U╜U-1)/0' '''Incorrect. Try again''' '╕L1'                           °
  636. *(1996 4 6 16 11 3 224)                                                        °
  637.  Ftri ÉFX 'U╜tri' 'Σ Draw 2d vector in plane' 'U╜r,''           B'',r'         °
  638.   'U╜U,''          /|'',r ''       /  |'',r,''      /    |'',r'                °
  639. X 'U╜U,''    /      |'',r,''  / α      |'',r,''O²²²²²²²²²²A'',r'               °
  640. *(1996 4 6 16 11 3 224)                                                        °
  641.  Ftri2 ÉFX 'U╜tri2' 'Σ Draw 2d vector in plane'                                °
  642.   'U╜r,''           B'',r ''         /|'',r'                                   °
  643.   'U╜U,''        /  |           b '',r'                                        °
  644.   'U╜U,''      /    |          /|'',r'                                         °
  645.   'U╜U,''    /      |        /  |'',r'                                         °
  646.   'U╜U,''  /        |      /    |'',r'                                         °
  647. X 'U╜U,''O²²²²²²²²²²A    o²²²²²²a'',r'                                         °
  648. XCuc 1 26 ABCDEFGHIJKLMNOPQRSTUVWXYZ                                           °
  649. *(1996 4 6 16 11 3 224)                                                        °
  650.  Fvec ÉFX 'U╜vec' 'Σ Draw 2d vector in plane'                                  °
  651.   'U╜r,''2-  °      '',r '':       '',r,''1-    °'',r'                         °
  652. X 'U╜U,'' :      °'',r,''0|....|....|'',r,'' 0    1    2'',r'                  °
  653.