Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #1893 > unrolled thread
| Started by | DrMajorBob <btreat1@austin.rr.com> |
|---|---|
| First post | 2011-04-27 09:37 +0000 |
| Last post | 2011-04-27 09:37 +0000 |
| Articles | 1 — 1 participant |
Back to article view | Back to comp.soft-sys.math.mathematica
Re: Mathematica loop question DrMajorBob <btreat1@austin.rr.com> - 2011-04-27 09:37 +0000
| From | DrMajorBob <btreat1@austin.rr.com> |
|---|---|
| Date | 2011-04-27 09:37 +0000 |
| Subject | Re: Mathematica loop question |
| Message-ID | <ip8o3u$pe5$1@smc.vnet.net> |
Or this (after Patrick Scheibe):
Module[{num = 10, m = RotationMatrix[3/4 Pi], yMax},
yMax = Last[m.{num, 1}];
Graphics[{EdgeForm@Directive[Thin, Black],
Table[{x, y} = m.{i, j}; {ColorData["TemperatureMap"][y/yMax],
Disk[{x, y}, 0.4]}, {i, 0, num}, {j, 0, i}]}]]
Bobby
On Tue, 26 Apr 2011 03:43:16 -0500, Sol Lederman <sol.lederman@gmail.com>
wrote:
> Hi,
>
> I'm teaching myself Mathematica.
>
> I've plotted this:
>
> Graphics[{
> Blue,
> Disk[{5, 10}, .25],
> Disk[{4, 9}, .25],
> Disk[{6, 9}, .25],
> Disk[{3, 8}, .25],
> Disk[{5, 8}, .25],
> Disk[{7, 8}, .25],
> Disk[{2, 7}, .25],
> Disk[{4, 7}, .25],
> Disk[{6, 7}, .25],
> Disk[{8, 7}, .25],
> Disk[{1, 6}, .25],
> Disk[{3, 6}, .25],
> Disk[{5, 6}, .25],
> Disk[{7, 6}, .25],
> Disk[{9, 6}, .25]
> }]
>
>
> Is there an elegant way to write this without a bunch of Disk statements?
> I'm imagining that this would be a double nested loop.
>
>
> Thanks.
>
>
> Sol
--
DrMajorBob@yahoo.com
Back to top | Article view | comp.soft-sys.math.mathematica
csiph-web