home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: sci.math.symbolic
- Path: sparky!uunet!spool.mu.edu!sdd.hp.com!usc!elroy.jpl.nasa.gov!nntp-server.caltech.edu!rotenber
- From: rotenber@cco.caltech.edu (James Michael Rotenberry)
- Subject: Mma Koch Snowflake in Not. of AMS
- Message-ID: <1992Sep13.205317.28950@cco.caltech.edu>
- Sender: news@cco.caltech.edu
- Nntp-Posting-Host: alumni
- Organization: California Institute of Technology, Pasadena
- Date: Sun, 13 Sep 1992 20:53:17 GMT
- Lines: 41
-
-
-
- It appears that I either copied this program incorrectly,
- there was a typo in the publication (please see comment below),
- or the program is not correct.
-
- According to the 1991 version (2nd edition) of Wolfram's
- Mathematica book, FixedPoint does not allow multiple arguments.
-
- Can anyone say what is going on?
- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-
- (* program for a Koch snowflake. found in the Notices
- of the AMS Vol.39 #7 Sept 92, page 709 *)
- KochSnowflake[n_Integer?NonNegative]:=
- Show[Graphics[FixedPoint[
- (#1/.Line[{start_,finish_}]
- :>doline[start,finish]) &,
- {Line[{{0,0},{1/2,Sqrt[3]/2}}],
- Line[{{1/2,Sqrt[3]/2},{1,0}}],
- Line[{{1,0},{0,0}}]},
- n,]],
- AspectRatio->Automatic,PlotRange->All]
-
- doline[start_,finish_]:=
- Module[{vec,normal},
- vec=finish-start;
- normal=Reverse[vec] {-1,1} Sqrt[3]/6;
- {Line[{start,start + vec/3}],
- Line[{start + vec/3,start + vec/2 + normal}],
- Line[{start + vec/2 + normal, start + 2 vec/3}],
- Line[{start + 2 vec/3, finish}]
- }
- ]
-
- KochSnowflake[2]
-
- FixedPoint::argct: FixedPoint called with 4 arguments.
- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
- James M. Rotenberry
- rotenber@alumni.caltech.edu
-