home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / sci / math / symbolic / 2401 < prev    next >
Encoding:
Text File  |  1992-09-13  |  1.7 KB  |  53 lines

  1. Newsgroups: sci.math.symbolic
  2. Path: sparky!uunet!spool.mu.edu!sdd.hp.com!usc!elroy.jpl.nasa.gov!nntp-server.caltech.edu!rotenber
  3. From: rotenber@cco.caltech.edu (James Michael Rotenberry)
  4. Subject: Mma Koch Snowflake in Not. of AMS
  5. Message-ID: <1992Sep13.205317.28950@cco.caltech.edu>
  6. Sender: news@cco.caltech.edu
  7. Nntp-Posting-Host: alumni
  8. Organization: California Institute of Technology, Pasadena
  9. Date: Sun, 13 Sep 1992 20:53:17 GMT
  10. Lines: 41
  11.  
  12.  
  13.  
  14.       It appears that I either copied this program incorrectly,
  15.       there was a typo in the publication (please see comment below),
  16.       or the program is not correct.
  17.  
  18.       According to the 1991 version (2nd edition) of Wolfram's
  19.       Mathematica book, FixedPoint does not allow multiple arguments.
  20.  
  21.       Can anyone say what is going on?
  22. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  23.  
  24. (*  program for a Koch snowflake.  found in the Notices
  25.     of the AMS Vol.39 #7 Sept 92, page 709  *)
  26. KochSnowflake[n_Integer?NonNegative]:=
  27.   Show[Graphics[FixedPoint[
  28.   (#1/.Line[{start_,finish_}]
  29.   :>doline[start,finish]) &,
  30.   {Line[{{0,0},{1/2,Sqrt[3]/2}}],
  31.   Line[{{1/2,Sqrt[3]/2},{1,0}}],
  32.   Line[{{1,0},{0,0}}]},
  33.   n,]],
  34.   AspectRatio->Automatic,PlotRange->All]
  35.  
  36. doline[start_,finish_]:=
  37.   Module[{vec,normal},
  38.   vec=finish-start;
  39.   normal=Reverse[vec] {-1,1} Sqrt[3]/6;
  40.   {Line[{start,start + vec/3}],
  41.   Line[{start + vec/3,start + vec/2 + normal}],
  42.   Line[{start + vec/2 + normal, start + 2 vec/3}],
  43.   Line[{start + 2 vec/3, finish}]
  44.   }
  45.   ]
  46.  
  47. KochSnowflake[2]
  48.  
  49. FixedPoint::argct: FixedPoint called with 4 arguments.
  50. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  51. James M. Rotenberry
  52. rotenber@alumni.caltech.edu
  53.