home *** CD-ROM | disk | FTP | other *** search
/ ProfitPress Mega CDROM2 …eeware (MSDOS)(1992)(Eng) / ProfitPress-MegaCDROM2.B6I / GRAPHICS / MISC / TSDRAW14.ZIP / TSDRAW.INF < prev    next >
Encoding:
Text File  |  1991-09-08  |  16.8 KB  |  483 lines

  1.  
  2.                            - 1 -
  3. Sun 8-September-1991
  4.  
  5. DRAW LINEs, Copyright (c) by Prof. Timo Salmi, (Ver. 1.4)
  6. Address: University of Vaasa, P.O.Box 297, SF-65101, Finland
  7. Email: InterNet: ts@chyde.uwasa.fi  (preferred)
  8.        FuNet:    gado::salmi
  9.        BitNet:   SALMI@FINFUN
  10.  
  11. All rights reserved. Please duly observe the copyright notes in
  12. Chapter 7 of this document.
  13.  
  14. DRAWLINE is a graphics system for displaying and demonstrating
  15. equations of two variables (that is lines) on an x and y coordinate
  16. plane. In particular, the system has been developed for graphical
  17. presentation of small linear programming problems, but it is
  18. suitable for other line-drawing applications, too.
  19.  
  20. The system has it own command language. First call DRAWLINE. The
  21. screen will be divided into two parts, the drawing window, and the
  22. command window at the bottom of the screen. To draw a line, say 2x +
  23. 3y = 6, type the command li 2,3,6 and the line will be drawn. There
  24. are many other graphics commands, and a number of calculation
  25. commands, as well. The commands can also be entered from a file such
  26. as LPDEMO.DRW. To list the commands type ? or help. For a full
  27. description of the commands, see the document TSDRAW.INF.
  28.  
  29. To run DRAWLINE your computer must have a CGA, EGA or VGA graphics
  30. adapter. The system applies four-color CGA graphics.
  31.  
  32.  
  33. 1. Basic graphics commands
  34. --------------------------
  35.  
  36. First call drawline at the MsDos prompt. The graphics and command
  37. windows will be opened, the axes will be drawn in the default color
  38. (yellow), and you will be prompted for the commands by > at the
  39. command window. These commands suffice to get started:
  40.  
  41.    li a,b,c     Draws the line ax + by = c
  42.  
  43.    help         Show the list of commands.
  44.  
  45.    nw           Start anew. Clear the drawing window, and reset all
  46.                 settings.
  47.  
  48.    quit         Ends the drawline session and returns to MsDos.
  49.                 Exit can be used as a synonym for quit.
  50.  
  51.  
  52.                            - 2 -
  53.  
  54. Also the following basic commands can be used:
  55.  
  56.    l2 a,k       Draws the line y = a + kx
  57.  
  58.    sg x1,y1,x2,y2  Draws a line segment from x1,y1 to x2,y2.
  59.  
  60.    po x,y       Draws a point at x,y (actually a small circle).
  61.  
  62.    cl           Clear the drawing window, but preserve any settings.
  63.  
  64. There are many other commands for handling graphics and relevant
  65. calculations which will be taken up in the following chapters.
  66.  
  67.  
  68. 2. Colors
  69. ---------
  70.  
  71. The default color for drawing is yellow. You can change the drawing
  72. color by using
  73.  
  74.    ik color
  75.  
  76. where the color is a one letter code: b(lack), g(reen), r(ed), and
  77. y(ellow). Alternatively codes 0, 1, 2, and 3 can be used.
  78.  
  79. To rub a line, redraw it is black (the background color). For
  80. example if you have drawn li 2.5,3.5,10 and want to erase it, apply
  81.  ik b
  82.  li 2.5,3.5,10
  83.  ik y
  84.  
  85.  
  86. 3. Filling areas
  87. ----------------
  88.  
  89. It is possible to fill a closed area. This can be used, for
  90. instance, to indicate the area of feasible solutions in graphical
  91. presentation of linear programming problems (see lpdemo.drw).
  92.  
  93.    fi x,y   Floods the area bordered with yellow lines containing
  94.             the point x,y. (See release notes for version 1.3.)
  95.  
  96. Note that if you have pierced the relevant yellow lines with lines
  97. of other colors, and use fill, the flooding color will leak though
  98. the holes. Therefore you must see to it that the yellow borders are
  99. intact before applying fill.
  100.  
  101.  
  102.                            - 3 -
  103.  
  104. 4. Loading data from a file
  105. ---------------------------
  106.  
  107. It is possible to take the commands from a file as demonstrated by
  108. the demo.drw file. To do this, apply
  109.  
  110.    ld filename        Load commands from filename
  111.  
  112. The syntax of a command file is the same as in entering the commands
  113. from the keyboard. In addition, the exclamation mark (!) can be used
  114. for comments in files. See lpdemo.drw for details.
  115.  
  116.  
  117. 5. Advanced graphics commands
  118. -----------------------------
  119.  
  120. You can redraw the the axes anytime. You can also have a dotted grid
  121. on the screen. (Note that the current color will be used. The
  122. current color can be changed by ik command, as documented earlier.)
  123.  
  124.    ax      Redraw the axes
  125.  
  126.    ax5     Draw thick notches on the axes every 5 units apart.
  127.  
  128.    gr      Draw a dotted grid to the drawing window.
  129.  
  130. The notches on the axes are considered to be one unit apart from
  131. each other. Thus, for example, the fifth notch on the horizontal
  132. axis (x-axis) will present 5, not 50, not 0.5. You may want to
  133. change this in accordance of your application. There is a scaling
  134. command for that.
  135.  
  136.    sc fx,fy  Change scale of the x-axis to fx and y-axis to fy,
  137.              where fx and fy denote the number of units that lies
  138.              between two adjacent nothes on the axes.
  139.  
  140. For example, if you want the fifth notch to present 50, then apply
  141. sc 10. And, if you want it to present 500, apply sc 100, and so on.
  142. The f parameter, like all the other parameters, is a real number.
  143. Thus you could enter, for example, sc 34.7, even if there is no
  144. sense in such a scale.
  145.  
  146. You can also change the location and the proportions of the axes
  147. (and the grid) by changing the relevant defaults. To utilize this
  148. you will have to have a some understanding of the pixel system used
  149. in computer graphics. The parameters are the following.
  150.  
  151.  
  152.                            - 4 -
  153.  
  154. xpix  = the horizontal location of the grid origin, in pixels from
  155.         the lower left-hand corner of the window. The width of the of the
  156.         graphics window is 1500 pixels, and its hight is 1000
  157.         pixels. (For those in the know the CGA four-color screen
  158.         actually uses a 320x200 pixel system, but I use the
  159.         1500x1000 system internally to make my programs easily
  160.         adaptable to the different graphics drivers.) The default is
  161.         250 pixels.
  162.  
  163. ypix  = the vertical location of the grid origin. The default is
  164.         150 pixels.
  165.  
  166. dxpix = the distance between the notches on the x-axis, in the
  167.         1500x1000 pixel system. The default is 80 pixels.
  168.  
  169. dypix = the distance between the notches on the y-axis, in the
  170.         1500x1000 pixel system. The default is 75 pixels.
  171.  
  172. To change the defaults, apply
  173.  
  174.    or xpix,ypix     Relocate origin to xpix,ypix.
  175.  
  176.    no dxpix,dypix   Change the notch distances to dxpix and dypix.
  177.  
  178.  
  179. 6. Calculator commands
  180. ----------------------
  181.  
  182. There are commands which do not draw anything, but perform relevant
  183. calculations for the user:
  184.  
  185.    eq x1,y1,x2,y2         Gives the equation ax+by=c of a line going
  186.                           through points (x1,y1) and (x2,y2). c is
  187.                           always made non-negative.
  188.  
  189.    es x1,y1,x2,y2,sc      Like eq, but scales the a, b, and c by
  190.                           multiplying with sc.
  191.  
  192.    sv a1,b1,c1,a2,b2,c2   Solves the simultaneous equations
  193.                             a1*x + b1*y = c1
  194.                             a2*x + b2*y = c2
  195.  
  196.    ic a,b,c               Calculates the intercepts of ax+by=c
  197.                           with the axes.
  198.  
  199.  
  200.  
  201.  
  202.                            - 5 -
  203.  
  204. The basic arithmetics are available:
  205.  
  206.    ad a,b,...       Addition a + b + ...
  207.  
  208.    sb a,b           Subtraction a - b
  209.  
  210.    ml a,b,...       Multiplication a * b * ...
  211.  
  212.    dv a,b           Division a / b
  213.  
  214.    cr a,b,c,d       Cross product a * b + c * d
  215.  
  216.  
  217. 7. About distributing and using the system
  218. ------------------------------------------
  219.  
  220. All rights reserved. The tsdraw package including drawline system
  221. may be used and distributed freely for PRIVATE, NON-COMMERCIAL,
  222. NON-INSTITUTIONAL purposes, provided no changes are made to the
  223. package (with the exception of a change in the packing method). No
  224. part of this package must be distributed separately. For ANY other
  225. usage, such as use in a business enterprise or at a university,
  226. please contact the author for information on registration. Using
  227. this program in business or classroom, or under other comparable
  228. public circumstances, without a permission, is a direct violation
  229. of the author's copyright.
  230.  
  231. The programs are under development. Comments and contacts are
  232. solicited. If you have any questions, please do not hesitate to use
  233. electronic mail for communication.
  234.  
  235. The author shall not be liable to the user for any direct, indirect
  236. or consequential loss arising from the use of, or inability to use,
  237. any program or file howsoever caused. No warranty is given that the
  238. system will work under all circumstances.
  239.  
  240.  
  241.  
  242.  
  243.  
  244.  
  245.  
  246.  
  247.  
  248.  
  249.  
  250.  
  251.  
  252.                            - 6 -
  253.  
  254. 8. Summary of Commands
  255. ----------------------
  256.  
  257. Graphics commands:                                      LONG FORM
  258.   ar x,y,a,b,r              ARc at x,y; angl a to b     Arc
  259.   ax                        redraw AXes                 Axes
  260.   ax5                       notch AXes at 5 units       Axes5
  261.   br x,y,n                  BaR at x,y n chars wide     Bar
  262.   ci x,y,r                  CIrcle at x,y radius r      Circle
  263.   cl                        CLear without resetting     Clear
  264.   fi x,y[,p,c]              FIll at seed x,y            Fill
  265.   gr                        draw dotted GRid            Grid
  266.   gr1                       draw pixel GRid             Grid1
  267.   ik color                  InK color [b g r y]         Ink
  268.   lb x,y,text               LaBel                       Label
  269.   ld name                   LoaD data from file         Load
  270.   li a,b,c                  draw LIne ax + by = c       Line
  271.   l2 a,k                    draw Line y = a + kx        Line2
  272.   no xpix,ypix              change NOtching             Notch
  273.   nw                        NeW: clear and reset        New
  274.   or xpix,ypix              relocate ORigin             Origin
  275.   pi x,y                    PIxel at x,y                Pixel
  276.   po x,y                    indicate POint at x,y       Point
  277.   quit (exit)               QUIT the program              -
  278.   sg x1,y1,x2,y2            draw SeGment                Segment
  279.   sc fx,fy                  reset SCaling factors       Scale
  280.   tr x,y,r                  TRiangle                    Triangle
  281.  
  282. Calculator commands:
  283.   eq x1,y1,x2,y2            make EQuation         Equation
  284.   es x1,y1,x2,y2,sc         Equation Scaled       EquationScaled
  285.   ic a,b,c                  InterCept             Intercept
  286.   sv a1,b1,c1,a2,b2,c2      SolVe equations       Solve
  287.   ad a,b,...                ADd a+b+...             -
  288.   sb a,b                    SuBtract a-b            -
  289.   ml a,b,...                MuLtiply a*b*..         -
  290.   dv a,b                    DiVide a/b              -
  291.   cr a,b,c,d                CrossProduc a*b+c*d     -
  292.  
  293. Other commands:
  294.   di                        DIrectory             Directory
  295.   rt                        Recording toggle      RecordToggle
  296.   sh                        msdos SHell           Shell
  297.   st                        stop; files only      Stop
  298.  
  299.  
  300.  
  301.  
  302.                            - 7 -
  303.  
  304. 9. Release notes
  305. ----------------
  306.  
  307. Version 1.1 has the following enhancements and fixes:
  308. ===========
  309.  
  310. - The command cr for calculating a cross product.
  311.  
  312. - Scaling of the axes need not be the same. The earlier sc f command
  313.   has been changed to sc fx,fy.
  314.  
  315. - The label command (lb) now also allows capital letters and
  316.   multi-word text (maximum 25 words).
  317.  
  318. - The foreign and special characters (ascii 128-254) can be used. To
  319.   have them properly displayed, you must have loaded MsDos graftabl
  320.   utility.
  321.  
  322. - More thorough check of the filename in loading the commands from
  323.   a file with the ld command.
  324.  
  325. - Arc, bar, circle and pixel drawing commands.
  326.     ar x,y,start_angle,end_angle,r
  327.     br x,y,n                        (see help and simeq.drw)
  328.     ci x,y,r
  329.     pi x,y
  330.  
  331. - The small circle drawn by the point (po x,y) command has been made
  332.   thicker and a little bigger.
  333.  
  334. - A simultaneous equations demonstration simeq.drw has been
  335.   included.
  336.  
  337. - A break-even analysis demonstration has been included in the
  338.   package. The files are breakev.drw and breakev2.drw.
  339.  
  340. - A linear programming sensitivity analysis demonstration sequence
  341.   lpdemo1.drw - lpdemo4.drw has been included.
  342.  
  343. - The break key has been inactivated because breaking out of a
  344.   graphics program leaves the screen "in a funny state".
  345.  
  346.  
  347.  
  348.  
  349.  
  350.  
  351.  
  352.                            - 8 -
  353.  
  354. Version 1.2 has the following enhancements and fixes:
  355. ===========
  356.  
  357. - The choice of palette. The program call DRAWLINE takes palette
  358.   (0..3) as a parameter. The default is 0, and gives the right
  359.   colors for the ik (ink) command. In the earlier versions the
  360.   palette always was palette 1. To see the effect of using the
  361.   different palettes, I suggest you experiment with them.
  362.   The usage is
  363.     DRAWLINE [palette (0..3)]
  364.  
  365. - The color code d (default) in the ik (ink) command is no longer
  366.   acceptable. I decided that is was best to omit it with the
  367.   introduction of the palettes.
  368.  
  369. - Colors can optionally be given as numbers from 0 to 3. Do not
  370.   confuse this with the concept of the palette, where 0 denotes
  371.   CGAC0, 1 CGAC1, and so on.
  372.  
  373. - Directory command
  374.     di
  375.   lets you look at directories from within drawline.
  376.  
  377. - MsDos shell command
  378.     sh
  379.   gives a gateway to MsDos. Return to drawline by typing exit, as is
  380.   usual for MsDos shells.
  381.  
  382. - The filename extension defaults now to .drw. In other words if a
  383.   stored drawing is loaded from a file (ld command), and no
  384.   extension is given in the filename, drawline assumes .drw as the
  385.   extension. To load a file which truly has no extension in the
  386.   filename, append a point (.) to the filename.
  387.  
  388. - Stop command
  389.     st
  390.   This command can be placed in the input file for interrupting the
  391.   flow of commands. It is convenient in building and testing drawing
  392.   files. It is for files only. When used in the ordinary interactive
  393.   command mode, st does not do anything.
  394.  
  395.  
  396.  
  397.  
  398.  
  399.  
  400.  
  401.  
  402.                            - 9 -
  403.  
  404. Version 1.3 has the following enhancements and bug fixes:
  405. ===========
  406.  
  407. - Optional pattern and (border) color parameters in the fill command
  408.     fi x, y, [p(attern)], [c(olor)]
  409.  
  410.   Pattern and color in fill are advanced options. You have to be
  411.   both skillful and patient with them. The pattern can range from 0
  412.   to 11. The default is 9. Load pattern.drw to see the different
  413.   patterns. Notice that if you try to fill an area already filled
  414.   with a pattern, the new pattern will not probably be what you'd
  415.   expect, since the old pattern defines new (tighter) borders for
  416.   the area to be filled.
  417.  
  418.   The color can range from 0 to 3 (must be given as a digit, not as
  419.   a letter b,g,r,y).  Color defines which color is used as the border
  420.   when filling. The default border color is 3, that is yellow. See
  421.   smiley.drw for a simple demonstration.
  422.  
  423. - Fixed (hopefully) the scaling bug in the line commands li and
  424.   l2. Contrary to the other drawing commands li and l2 did not
  425.   draw in the correct position when the scale of the axes had been
  426.   changed with the sc command.
  427.  
  428. - Added tabulate to the command parameter separators. Thus the
  429.   following formats are acceptable, for example, in the l2 command:
  430.     l2 1, 2
  431.     l2 1 2
  432.     l2<tab>1<tab>2
  433.   as well as all their combinations.
  434.  
  435. - Most importantly, version 1.3 introduces the record mode. If
  436.   DRAWLINE is called with /r parameter, the commands given from the
  437.   keyboard are echoed to tmp.drw file. The record mode can be
  438.   toggled on and off using the rt command provided that the /r
  439.   switch was initially used.
  440.  
  441. - /s switch suppresses sound. The usage of drawline 1.3 is
  442.   DRAWLINE [palette (0..3)] [/r(ecord)[filename]] [/s(ilence)]
  443.  
  444. - Pixel grid command gr1 draws a grid made of single pixels. It is
  445.   less imposing than the gr pattern.
  446.  
  447. - Optional long forms of commands. See the summary of commands,
  448.   Chapter 8.
  449.  
  450.  
  451.  
  452.                            - 10 -
  453.  
  454.  
  455. - Allowed usage of EGA64 and IBM8514 graphics drivers. This
  456.   program has, however, only been tested with CGA and VGA
  457.   adapters, so I do not know whether they are functional.
  458.  
  459.  
  460. Version 1.4 has the following enhancements and bug fixes:
  461. ===========
  462.  
  463. - Added line-editing and recall potential when input is given from
  464.   the keyboard. This means that the CursorLeft, CursorRight, Home,
  465.   End, BackSpace, Delete, and Esc keys can be used to edit the
  466.   input. Futhermore the latest input can be recalled by pressing the
  467.   CursorUp key. Some CGA PCs may experience flicker, but CGA
  468.   adapters are archaic, anyway.
  469.  
  470. - The sh command takes the user to the MsDos shell (and the exit
  471.   command in the shell takes the user back to the program). Added
  472.   [TS] to the user's prompt while in the shell as a reminder that
  473.   the shell is being used. This reminder is useful for avoiding
  474.   running out of memory by eg calling the program again from within
  475.   the shell.
  476.  
  477. - A simple correction of the email address information.
  478.  
  479. - Rewrote the di (give directory routine).
  480.  
  481. - On exit back to the text mode the date and the total elapsed time
  482.   are given.
  483.