Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #13789 > unrolled thread

Re: Numbers on rectangles

Started byBob Hanlon <hanlonr357@gmail.com>
First post2013-03-09 10:25 +0000
Last post2013-03-10 05:47 +0000
Articles 2 — 2 participants

Back to article view | Back to comp.soft-sys.math.mathematica

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Numbers on rectangles Bob Hanlon <hanlonr357@gmail.com> - 2013-03-09 10:25 +0000
    Re: Numbers on rectangles Clif McInnis <c_mcinnis@hotmail.com> - 2013-03-10 05:47 +0000

#13789 — Re: Numbers on rectangles

FromBob Hanlon <hanlonr357@gmail.com>
Date2013-03-09 10:25 +0000
SubjectRe: Numbers on rectangles
Message-ID<khf2n0$bk5$1@smc.vnet.net>
Module[{pt, n = 1},
 SetOptions[
  Graphics,
  PlotRange -> {{-2, 8}, {-2, 8}}];
 Graphics[{
   Table[
    Locator[
     pt = RandomReal[6, 2],
     Graphics[{
       EdgeForm[Black],
       Opacity[.5],
       Hue[RandomReal[]],
       Rotate[
        Rectangle[pt],
        RandomReal[2 Pi]],
       Black,
       Opacity[1],
       Text[
        Style[n++, Bold, 16],
        pt + {.5, .5}]}]],
    {RandomInteger[{1, 9}]}]}]]


Bob Hanlon


On Fri, Mar 8, 2013 at 6:08 PM, C McInnis <c_mcinnis@hotmail.com> wrote:
>
> Bob,
>
>
> Thank you very much. I am going to spend some time looking over this code,
> as this now bring a question to mind which is; can the numbers be tied to
> the rectangles so that when a rectangle is moved the number will move with
> it, thus allowing the student to arrange the rectangles in numerical order.
> I had looked at the =93counting order puzzle=94 at the demonstrations site, but
> felt that it would be a bit too complicated for young students and they
> would lose interest before they were able to show whether or not they could
> arrange the numbers. Again many thanks for your assistance.
>
>
>
> Clif McInnis
>
>> Date: Fri, 8 Mar 2013 17:37:14 -0500
>> Subject: Re: Numbers on rectangles
>> From: hanlonr357@gmail.com
>> To: c_mcinnis@hotmail.com
>> CC: mathgroup@smc.vnet.net
>
>>
>> Module[{pt, n = 1},
>> Graphics[{
>> EdgeForm[Black],
>> Table[
>> {Opacity[.5],
>> Hue[RandomReal[]],
>> Rotate[
>> Rectangle[pt = RandomReal[2, 2]],
>> RandomReal[2 Pi]],
>> Opacity[1],
>> Black,
>> Text[Style[n++, Bold, 18], pt + {.5, .5}]},
>> {RandomInteger[{1, 9}]}]}]]
>>
>>
>> Bob Hanlon
>>
>>
>> On Fri, Mar 8, 2013 at 4:47 PM, <c_mcinnis@hotmail.com> wrote:
>> > Hello to all,
>> > I am trying to put numbers on rectangles. I found this little
>> > demonstration under the heading of =93Rectangles=94->=94Neat Examples=94. I
>> > thought that it would be a good tool to help a young student learn to count,
>> > however I cannot find a way to put numbers on the rectangles. I looked at a
>> > couple of examples in the demonstrations projects where numbers had been
>> > assigned to disks, however that didn't seem to work with rectangles. I also
>> > saw some documentation in the help section on =93Inset=94 that labeled a
>> > circle, but that did not work either. After finding no posts regarding this
>> > topic either here or at the education forum, I decided that I might try to
>> > ask.
>> >
>> > Graphics[{EdgeForm[Black],
>> > Table[{Hue[RandomReal[]],
>> > Rotate[Rectangle[RandomReal[2, 2]], RandomReal[2 Pi]]}, {20}]}]
>> >
>> > I have modified the code to produce a random, and smaller, number of
>> > rectangles, as is shown below.
>> >
>> > Graphics[{EdgeForm[Black],
>> > Table[{Hue[RandomReal[]],
>> > Rotate[Rectangle[RandomReal[2, 2]],
>> > RandomReal[2 Pi]]}, {RandomInteger[{1, 9}]}]}]
>> >
>> > Would love to have each rectangle take on a distinct color, the more
>> > basic ones if possible, but just having a number on each rectangle would be
>> > great. Many thanks for any and all considerations and suggestions.
>> > Clifton
>> >

[toc] | [next] | [standalone]


#13795

FromClif McInnis <c_mcinnis@hotmail.com>
Date2013-03-10 05:47 +0000
Message-ID<khh6os$akj$1@smc.vnet.net>
In reply to#13789
Bob,

That works really well, thank you for showing me how this should be coded. Hope that you have a great day.

Clif


[toc] | [prev] | [standalone]


Back to top | Article view | comp.soft-sys.math.mathematica


csiph-web