MathGroup Archive 2010

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

Search the Archive

Re: plotting many curves

  • To: mathgroup at smc.vnet.net
  • Subject: [mg108348] Re: plotting many curves
  • From: Bob Hanlon <hanlonr at cox.net>
  • Date: Sun, 14 Mar 2010 05:16:12 -0500 (EST)

n = 20;
xoi = RandomReal[{-10, 10}, n];
yoi = RandomReal[{-10, 10}, n];
ri = RandomReal[{0, 10}, n];

circles = Thread[{
    xoi + ri*Cos[t],
    yoi + ri*Sin[t]}];

ParametricPlot[circles, {t, 0, 2 Pi}]


Bob Hanlon

---- eric g <eric.phys at gmail.com> wrote: 

=============
Hello Group,

I know I should avoid For cycles in mathematica, but I am C person... 
how to do this without For

(*--------initialization------------------*)
n = 10^2;
xoi = RandomReal[{-10, 10}, {n}];
yoi = RandomReal[{-10, 10}, {n}];
ri = RandomReal[{0, 10}, {n}];
-----------------------------------
(*

n=10^2;
Clear[circles];
circles = Table[Null, {n}];
For[i = 1, i <= n, i++,
  circles[[i]] = {xoi[[i]] + ri[[i]]*Cos[t], yoi[[i]] + ri[[i]]*Sin[t]}]

(*---------------displaying--------------------*)
ParametricPlot[circles, {t, 0, 2 Pi}, PlotStyle -> Black]



  • Prev by Date: Building a list of all words of length less than k in a given
  • Next by Date: Re: plotting many curves
  • Previous by thread: plotting many curves
  • Next by thread: Re: plotting many curves