Re: Noah's List
- To: mathgroup at smc.vnet.net
- Subject: [mg5712] Re: Noah's List
- From: Hans Havermann <haha at astral.magic.ca>
- Date: Sat, 11 Jan 1997 14:29:08 -0500
- Sender: owner-wri-mathgroup at wolfram.com
I wrote:
>I have two lists, x and y, each containing n elements. I would like to
>generate a new list, {{x[[1]],y[[1]]}, {x[[2]],y[[2]]},...
>{x[[n]],y[[n]]}}, but have been unable to figure out a shorthand for it.
A collective thank you to the (currently 14) people who responded to this.
Transpose[{x,y}] was the most common suggestion with Thread[{x,y}] a
distant second. Also offered were MapThread[List,{x,y}] and
Table[{x[[k]],y[[k]]},{k,1,Length[x]}].
I am using the function to investigate the "square root" spiral, calculated
and drawn by Robert Stanley Beard some 40 years ago [See "Patterns in
Space", Creative Publications (1973), p.209]. The spiral may be thought of
as the concatenation of triangles with sides 1, n^(1/2), and (n+1)^(1/2),
for n=1 to infinity.
angle[n_]:=ArcTan[1/n^(1/2)]
x[n_]:=Range[n]^(1/2)*Cos[FoldList[Plus,0,angle[Range[n-1]]]]
y[n_]:=Range[n]^(1/2)*Sin[FoldList[Plus,0,angle[Range[n-1]]]]
z[n_]:=Transpose[{x[n],y[n]}]
sets up the data points as *exact* expressions.
ListPlot[z[111],PlotJoined->True,AspectRatio->Automatic]
will draw 3 revolutions of the spiral, omitting the triangles' spokes to
the origin. Thank you again.
--
HaHa
Rarebit Dreams