home *** CD-ROM | disk | FTP | other *** search
/ Otherware / Otherware_1_SB_Development.iso / mac / misc / math / mathgrap.sit / MathGrapher / card_5904.txt < prev    next >
Encoding:
Text File  |  1989-07-28  |  3.9 KB  |  84 lines

  1. -- card: 5904 from stack: in
  2. -- bmap block id: 4708
  3. -- flags: 2000
  4. -- background id: 5839
  5. -- name: Polynomials
  6.  
  7.  
  8. -- part 8 (button)
  9. -- low flags: 00
  10. -- high flags: A003
  11. -- rect: left=410 top=51 right=108 bottom=493
  12. -- title width / last selected line: 0
  13. -- icon id / first selected line: 9986 / 9986
  14. -- text alignment: 1
  15. -- font id: 0
  16. -- text size: 12
  17. -- style flags: 0
  18. -- line height: 16
  19. -- part name: Function Editor
  20. ----- HyperTalk script -----
  21. on mouseDown
  22.   -- This is the Pop Up Menu XFCN
  23.   get popupmenu ("Zeroth,^S 1st,^T 2nd,^U 3rd,^V 4th,^W 5th,^X 6th,^Y 7th,^Z 8th,^[ 9th,^\ Nth,",0, the mouseH, the mouseV )
  24.   put it-1 into temp
  25.   if it is empty then exit to HyperCard
  26.   -- This finds out what the person just selected
  27.   put 0 into degree
  28.   repeat with q = 1 to 10
  29.     if temp is q then put q into degree
  30.   end repeat
  31.   if degree = 10 then
  32.     ask  "What degree polynomial do you want?"
  33.     if it is empty then exit to HyperCard
  34.     put it into degree
  35.   end if
  36.   -- Find out what coefficient the person wants for that term
  37.   ask "Enter the numerical coefficient for this term." with "1"
  38.   if it is "Cancel" then exit to HyperCard
  39.   put it into coefficient
  40.   if coefficient >= 0 then put "+ " before coefficient
  41.   else put space before char 2 of coefficient
  42.   put coefficient & "*x^" & degree & space after fld "function"
  43. end mouseDown
  44.  
  45.  
  46. -- part contents for background part 3
  47. ----- text -----
  48. Polynomial Functions
  49. A*x^n + B*x^(n-1) + C*x^(n-2) + ... + D
  50.  
  51. -- part contents for background part 4
  52. ----- text -----
  53. Polynomial Function Editor
  54.  
  55. -- part contents for background part 2
  56. ----- text -----
  57. You can use this card to edit and write the polynomial equation you wish to be graphed.  Use the "Function Editor" button or enter your equation directly below.  Use the
  58. "Graph Equation" button to actually graph your work. 
  59. If you'd like to read more, click this button -->   
  60.  
  61. -- part contents for background part 5
  62. ----- text -----
  63. The word polynomial is defined in Webster's dictionary as an algebraic expression with two or more terms.  If you are a fan of etymology then you will be able to distinguish two parts of the word.  The first is "poly" and the second is "nomial".  The suffix "poly" has the meaning of "many" and the root word "nomial" has the meaning of "name".
  64. An appropriate mathematical definition for polynomial is a group of ordered terms ordered from highest to lowest degree.  A few examples of polynomials are:
  65.  
  66.  
  67. The numbers above the x's are the exponents.  The numbers in front of the x's are called coefficients.  For example the first polynomial has two terms.  Its first term has 5 as a coeficient and is raised to the 1 power.  The third polynomial has five terms.  Its first term is raised to the 6th power and it's fourth term has a coefficient of 5/8.
  68. In order for this stack to graph your polynomial you must write it in a standardized form.  If you understand HyperTalk you will be able to do this already.  
  69.  
  70. Here are the "rules":  ΓÇó  Multiplication is shown by using an asterisk *
  71.                                   ΓÇó  Powers are shown with the circumflex  ^
  72. So the first polynomial written in standard form would look like 5*x + 7.  The second polynomial would be written like x^2 + 2*x - 1.  The third polynomial would look like x^6 + 4*x^3 - x^2 + (5/8)*x - 3.
  73.  
  74. You can enter your polynomial in two ways.  You can write it directly into standard form or you could use the Term Editor button.  By holding the Term Editor button down you can select which term you want to work on by selecting its number.  If you have a term with a power greater than 9 then use the "Nth" menu.  After you have finished writing your polynomial use the Graph Equation button to go to the graphing card.   If you would like to start over with your equation then you could use the "Erase Edit Box" button.  
  75. To dismiss this help section click anywhere.
  76.  
  77.  
  78. -- part contents for background part 7
  79. ----- text -----
  80. Polynomial Edit Box
  81.  
  82. -- part contents for background part 1
  83. ----- text -----
  84.  1*x^3 + 8*x^2