Prev: MathLink in Vista
Next: Why?
From: MH on
Hello. I'm trying to create a basic demonstration to generate a
hexagon tiling. My code below generates a single row of tiled
hexagons, running from quadrant 3 into quadrant 1. But this is
essentially only one dimension of hexagons; now I'd like to fill
"above" and "below" this one row, and I'm not sure how to accomplish
that.

I'm familiar with some Mathematica basics but I'm still relatively new
to coding my own demonstrations. I feel like I understand exactly
what I'd like to accomplish without a sense of how to accomplish it,
so I appreciate any guidance you can offer.

I've also seen the example on MathWorld. I've even downloaded the
available workbook (which does just what I want!), but I'd prefer to
write my own version.

http://mathworld.wolfram.com/HexagonalGrid.html

Thanks!

MH

==========

Manipulate[
Graphics[
Table[
{Yellow,
EdgeForm[Thickness[0.005]],
Polygon[
Table[{Cos[2 Pi*k/6] + 3 i/2, Sin[2 Pi*k/6] + i*Sqrt[3]/2}, {k,
1, 6}]]},
{i, -5, x, 1}
],
PlotRange -> {{-10, 10}, {-10, 10}},
Axes -> True
],
{x, -5, 5, 1}
]

==========

From: jfb on
I ran across this earlier today in the Mathematica help under "polygon"

Graphics[{EdgeForm[Opacity[.7]], LightBlue,
Table[h[3 i + 3 ((-1)^j + 1)/4, Sqrt[3]/2 j], {i, 5}, {j, 10}]}]

On May 27, 6:46 am, MH <matthewh...(a)gmail.com> wrote:
> Hello. I'm trying to create a basic demonstration to generate a
> hexagon tiling. My code below generates a single row of tiled
> hexagons, running from quadrant 3 into quadrant 1. But this is
> essentially only one dimension of hexagons; now I'd like to fill
> "above" and "below" this one row, and I'm not sure how to accomplish
> that.
>
> I'm familiar with some Mathematica basics but I'm still relatively new
> to coding my own demonstrations. I feel like I understand exactly
> what I'd like to accomplish without a sense of how to accomplish it,
> so I appreciate any guidance you can offer.
>
> I've also seen the example on MathWorld. I've even downloaded the
> available workbook (which does just what I want!), but I'd prefer to
> write my own version.
>
> http://mathworld.wolfram.com/HexagonalGrid.html
>
> Thanks!
>
> MH
>
> ==========
>
> Manipulate[
> Graphics[
> Table[
> {Yellow,
> EdgeForm[Thickness[0.005]],
> Polygon[
> Table[{Cos[2 Pi*k/6] + 3 i/2, Sin[2 Pi*k/6] + i*Sqrt[3]/2}, {k=
,
> 1, 6}]]},
> {i, -5, x, 1}
> ],
> PlotRange -> {{-10, 10}, {-10, 10}},
> Axes -> True
> ],
> {x, -5, 5, 1}
> ]
>
> ==========


 | 
Pages: 1
Prev: MathLink in Vista
Next: Why?