MathGroup Archive 2010

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

Search the Archive

Dynamic Text in Manipulate.

  • To: mathgroup at smc.vnet.net
  • Subject: [mg112027] Dynamic Text in Manipulate.
  • From: Matthias Bode <lvsaba at hotmail.com>
  • Date: Wed, 25 Aug 2010 06:04:55 -0400 (EDT)

Hola:

The code below shifts a triangle with Manipulate[]. I want the coordinates 
of the corners A{x;y}, B{x;y}, C{x;y} inside the {;} to change 
with the shift.

Rather than my pedestrian dissecting method

 Text["A {", {2 - u, 7/5 - u*(4/5)}],
Text[Dynamic[2 - u, u], {2.2 - u, 7/5 - u*(4/5)}],
Text[";", {2.32 - u, 7/5 - u*(4/5)}],
Text[Dynamic[8/5 - u*(4/5), u], {2.45 - u, 7/5 - u*(4/5)}],
Text["}", {2.6 - u, 7/5 - u*(4/5)}],

in five steps I would like to represent "A{x;y}" in ONE command Text[].

How can this be done?

Best regards,

MATTHIAS BODE
S 17.35775=B0, W 066.14577=B0

gra01 = Plot[x, {x, 0, 5}, AspectRatio -> 1,
   PlotRange -> {{-0.5, 5.1}, {-0.5, 5}},
          AxesLabel -> {x, y},
   GridLines -> {{1, 2, 13/5, 4, 23/5}, {4/5, 8/5, 11/5, 16/5, 23/5}},
          PlotStyle -> Directive[White]];
Manipulate[Show[{gra01, Graphics[{Directive[PointSize[0.02]],
               
     Point[{{2 - u, 8/5 - u*(4/5)}, {4 - u,
        11/5 - u*(7/10)}, {23/5 - u, 23/5 - u*(7/10)}}],
                Directive[Thick],
     Line[{{2 - u, 8/5 - u*(4/5)}, {4 - u, 11/5 - u*(7/10)},
                      {23/5 - u, 23/5 - u*(7/10)}, {2 - u,
        8/5 - u*(4/5)}}], Directive[Dashed, Thin, Red],
               
     Line[{{2, 8/5}, {23/5, 8/5}, {23/5, 23/5}, {2, 23/5}, {2, 8/5}}],
                Line[{{4, 8/5}, {4, 11/5}}],
     Line[{{23/5, 11/5}, {4, 11/5}}],
                Directive[FontWeight -> Bold, FontSize -> 13, Black],
     Text["A {", {2 - u, 7/5 - u*(4/5)}],
                Text[Dynamic[2 - u, u], {2.2 - u, 7/5 - u*(4/5)}],
     Text[";", {2.32 - u, 7/5 - u*(4/5)}],
               
     Text[Dynamic[8/5 - u*(4/5), u], {2.45 - u, 7/5 - u*(4/5)}],
                Text["}", {2.6 - u, 7/5 - u*(4/5)}],
     Text["B {4; 11/5}", {4, 9/5}],
                Text["C {23/5; 23/5}", {22/5, 24/5}]}]}], {u, 0, 2,
  1/10}]



  • Prev by Date: i get an empty figure when exporting it, if I keep Epilogue->{.....}
  • Next by Date: Re: centering output of Manipulate
  • Previous by thread: Re: i get an empty figure when exporting it, if I keep Epilogue->{.....}
  • Next by thread: Re: Dynamic Text in Manipulate.