Re: plotting many curves
- To: mathgroup at smc.vnet.net
- Subject: [mg108339] Re: plotting many curves
- From: DC <b.gatessucks at gmail.com>
- Date: Sun, 14 Mar 2010 05:14:34 -0500 (EST)
- References: <hng24f$ru9$1@smc.vnet.net>
n = 5;
centers = RandomReal[{-10, 10}, {n, 2}];
radii = RandomReal[{0, 10}, {n}];
circles = {centers[[#, 1]] + radii[[#]] Cos[t],
centers[[#, 2]] + radii[[#]] Sin[t]} & /@ Range[n];
ParametricPlot[circles, {t, 0, 2 Pi}, PlotStyle -> Black]
-Francesco
On 03/13/2010 12:57 PM, eric g 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]
>
>
>