MathGroup Archive 2005

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Hexagonal Spiral

  • To: mathgroup at
  • Subject: [mg56962] Re: Hexagonal Spiral
  • From: Paul Abbott <paul at>
  • Date: Wed, 11 May 2005 05:24:29 -0400 (EDT)
  • Organization: The University of Western Australia
  • References: <d5mub1$dpm$>
  • Sender: owner-wri-mathgroup at

In article <d5mub1$dpm$1 at>, zak <chocolatez at> 

> the purpose of this message is to draw a hexagonal spiral and then
> divide every edge to the suitable numbers of points, then map the
> prime numbers to the all points of the spiral.

In a recent posting the following code for creating a spiral on an 
integer lattice was presented.   

  IntegerSpiral[n_] := {Re[#],Im[#]}& /@ 
     Fold[Join[#1, Last[#1]+I^#2 Range[#2/2]]&, {0}, Range[n]] 

The idea is that the length of the limbs of the spiral follow the 
pattern 1,1,2,2,3,3,4,4,5,5,... and that each limb is at a 90 degree 
angle to the previous limb (multiplication by I in the complex plane). 

Changing I to Exp[I Pi/3] means that each limb is at a 60 degree angle 
to the previous limb -- a hexagonal spiral:

  HexagonalSpiral[n_] := {Re[#],Im[#]}& /@ 
     Fold[Join[#1, Last[#1]+Exp[I Pi/3]^#2 Range[#2/2]]&, {0}, Range[n]] 

One can use

  spiral = HexagonalSpiral[100]

to construct the spiral,

  primes = spiral[[ Prime[Range[PrimePi[Length[spiral]]]] ]]; 

to find the prime points, and 

  ListPlot[spiral, PlotJoined->True, Axes -> False, 
    Epilog -> {PointSize[0.02], Point /@ primes}];

to draw the spiral and display those with prime index as dots.

> this is motivated by the figure:
> in an article in:

 Tweaking might be needed so as to get the above code to exactly 
correspond to this figure.


Paul Abbott                                      Phone: +61 8 6488 2734
School of Physics, M013                            Fax: +61 8 6488 1014
The University of Western Australia         (CRICOS Provider No 00126G)    

  • Prev by Date: Re: Re: Problem with substitutions in SparseArray?
  • Next by Date: Re: Re: FilledPlot: Curves->Back option and Epilog not working?
  • Previous by thread: Re: Hexagonal Spiral
  • Next by thread: Re: Mathematica Notebook Organization