MathGroup Archive 2002

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

Search the Archive

Re: Translations

  • To: mathgroup at
  • Subject: [mg32474] Re: Translations
  • From: "David P. Johnson" <johnson at>
  • Date: Tue, 22 Jan 2002 03:20:02 -0500 (EST)
  • Organization: New Mexico Tech
  • References: <a2gi1g$kl$>
  • Sender: owner-wri-mathgroup at

In article <a2gi1g$kl$1 at>, manuel avalos
<manuel at> wrote:

> 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

This can be done with a Do loop. If all you want to do is move the
triangle up and over by the same amount (6 as you stated above, this is
simple. First, here's the truangle you gave:


Next, put a ListPlot inside a Do loop, adding the increment 6i/30 to x
amd y for each vertex (6 is the amount you want to translate, and 30 is
the number of frames in the animation):


The PlotRange is required so that each frame in the animation has the
same axis ranges. If you double-click on the bracket (at right) that
encloses all the plots (but not the Do[] statement), they will all
collapse to one cell. Double click on this cell to play the animation.

If instead of translating up and over by the same amount, you'll have
to change it some, using the Table[] command. For instance, if you want
to move your triangle up six, but over only 2, then the following will
do it:


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

  • Prev by Date: RE: Translations
  • Next by Date: Tom Wickham Jones presents webMathematica course in Amsterdam
  • Previous by thread: RE: Translations
  • Next by thread: Programming question