MathGroup Archive 2002

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

Search the Archive

Re: Translations

  • To: mathgroup at smc.vnet.net
  • Subject: [mg32489] Re: Translations
  • From: "David P. Johnson" <johnson at nmtx.edu>
  • Date: Wed, 23 Jan 2002 01:00:10 -0500 (EST)
  • Organization: New Mexico Tech
  • References: <200201210755.CAA00607@smc.vnet.net> <a2j7fv$6v8$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

> Hello
>
> Perhaps if I state my problem you might suggest a method using
> mathematica how it could be accomplished.
> How can I translate a graph, say a triangle, in an R2 coordinate system
> to another given position on the x y plane showing all the various
> stages from the one position to the other?
> The triangle was formed by connecting the points (-4,4),(-3,-2) and
> (-2,-4) by straight lines...and another triangle was formed by
> translating that triangle by (6,6). Suppose you want to move the first
> triangle smoothly to the position of the second triangle using, let's
> say, a total of 31 frames numbered- 0, 1, 2,...30. How would one go
> about generating each frame?
> Thanks for whatever
> Manuel

triangle = {{-4, -4}, {-3, -2}, {-2, -4}, {-4, -4}};
Do[ListPlot[triangle + 6i/30, PlotJoined -> True, 
    PlotRange -> {{-4, 4}, {-4, 10}}], {i, 0, 30}]

The above only works if you want to translate up and over by the same
amount. Replace the Do with the following if you want to, say, move the
triangle over 6 and up only 2.

Do[ListPlot[
    Table[{triangle[[j, 1]] + 2i/30, triangle[[j, 2]] + 6i/30}, 
      {j, 1, 4}],PlotJoined -> True, PlotRange -> {{-4, 4}, 
      {-4, 10}}], {i, 0, 30}]

-- 
-David
(Signature continues here)
N.B.: Remove the 'x' to email me


  • References:
  • Prev by Date: memoizing function again
  • Next by Date: Re: PDF Format
  • Previous by thread: Re: Translations
  • Next by thread: Re: Translations