Re: zigzag & random walk

• To: mathgroup at smc.vnet.net
• Subject: [mg22334] Re: [mg22292] zigzag & random walk
• From: "Pascal BAES" <pascal.baes at skynet.be>
• Date: Fri, 25 Feb 2000 21:13:24 -0500 (EST)
• Sender: owner-wri-mathgroup at wolfram.com

```
>I'm searching for the formulas known as ZigZag and Long Random Walk.
>Can anyone help me to get the formulas or to a place where I can find
>more in formation ?

(*Skuse my Destroystyle: I'm Frenchy and Artist.(Not American or German
Scientist)
Cf that old stuf Maeder Package "Random Walk.m"
I used very much it to produce NoisySound (MassOfNonSinusoidaleVibration)
and CrispyAnimation
Thinks to eternal Mader...
there somme modified version, Whith "Seed control"*)

grange = N[{0, 2Pi}];
randomDelta1 := With[{dir1 = Random[Real, grange]},Sin[ dir1]];
(SeedRandom[i]; NestList[ # + randomDelta1&,0, n ]);

(*Thats Integer one: RandIntWalk*)
RandIntWalk[i_Integer,n_Integer] :=(SeedRandom[i];
NestList[(#+(-1)^Random[Integer])&,0,n])

(*thats 2D one:
grange = N[{0, 2Pi}];
randomDelta2 := With[{dir1 = Random[Real, grange]},{Sin[ dir1],Cos[dir1]}];
(SeedRandom[i]; NestList[ # + randomDelta2&,{0,0}, n ]);

(*Thats 2D one funny, from Point[{a,b}] to Point[{c,d}]
Plus[Join[{{a,b}},
Reverse[Join[{{c,d}},

grange = N[{0, 2Pi}];
randomDelta3 :=
With[{dir1 = Random[Real, grange],dir2 = Random[Real, grange]},{
Cos[dir1] Cos[dir2],Cos[dir1]Sin[ dir2],Sin[ dir1]}];
(SeedRandom[i]; NestList[ # + randomDelta3&,{0,0,0}, n ]);

(*ex1:*)

(*ex2:*)
{PointSize[0.02],  RGBColor[1,0,0] ,Point[{0,0}]}}]];

(*ex3:*)
A={-10.,-10.};
B={10.,10.};
Table[Show[
Graphics[{
RGBColor[1,0,0] ,Point[A]},{PointSize[0.05], RGBColor[0,0,1] ,
Point[B]}}],PlotRange->{{-15,15},{-15,15}}],{pe,20,50}]

(*ex4:*)
Table[Show[
Graphics3D[{
RGBColor[1,0,0] ,Point[{0,0,0}]}}],
PlotRange->{{-10,10},{-10,10},{-10,10}}],{n,10,50,2}];

Hope thats help
Pascal BAES
La Pose Longue
PataPhysik Lab

```

• Prev by Date: Riemann Sheets
• Next by Date: Re: Legend Package
• Previous by thread: Re: zigzag & random walk
• Next by thread: Re:Integrate with If--NDSolve