MathGroup Archive 2012

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

Search the Archive

how does Rotate in 2D work?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg127627] how does Rotate in 2D work?
  • From: "Nasser M. Abbasi" <nma at 12000.org>
  • Date: Wed, 8 Aug 2012 03:17:05 -0400 (EDT)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com
  • Delivered-to: l-mathgroup@wolfram.com
  • Delivered-to: mathgroup-newout@smc.vnet.net
  • Delivered-to: mathgroup-newsend@smc.vnet.net
  • Reply-to: nma at 12000.org

Suppose I have an arrow Arrow[{{0,0},{0,1}}] and I want
to rotate it 90 degrees, but taking the origin of the arrow
to be the point {0.5,0} when doing the rotation, instead of
the point {0,0} as it is above.

i.e. given

             |
             |
             +----->
          (0,0)    (1,0)

Now if I do Rotate on the above, by 90 degrees, with {0,0} as
origin, it gives, using the command

Graphics[{
   Rotate[Arrow[{{0, 0}, {1, 0}}], 90 Degree, {0, 0}]
   }, Axes -> True]


      (0,1)  ^
             |
             |
             +---
          (0,0)


So far so good. Now, I want to obtain this

                    ^
                    |
             |      |
             +------+
          (0,0)    (1,0)

i.e. I want the rotation to be around (1,0), and not (0,0).
I thought I can do it using the same command above, by just
changing {0,0} to {1,0} like this

Graphics[{
   Rotate[Arrow[{{0, 0}, {1, 0}}], 90 Degree, {1, 0}]
   }, Axes -> True]

But the above gave

             |     (1,0)
             +------+--
            (0,0)   ^
                    |
                    |

It is more strange when asking for rotation around say (.5,0),

Graphics[{
   Rotate[Arrow[{{0, 0}, {1, 0}}], 90 Degree, {.5, 0}]
   }, Axes -> True]

Now it gives
                   ^
             |     |
             +-----|------
            (0,0)  |(0.5,0)
                   |
                   |

So, I think this has to do what that 'bounding box' that help talks about,
but ofcourse help does not say how to change this or anything, and no
examples.

question is:
How can I use the Rotate command so that the _origin_ of the arrow
or the Line I want to rotate is where the rotation occur around? i.e
I want the arrow to be based from that rotation point before the
rotation start.

(I know there other ways to do this, using RotationMatrix and such,
but I wanted to find how to do it using Rotate). I think the
problem is with the Bounding Box thing, which I do not
understand now how to change in this case.

ps. Please WRI, improve your help pages more. Add more 'words' and
do not be so brief and cryptic in the description and add more
examples and add links to things you mention.

thanks.
--Nasser








  • Prev by Date: Re: Symmetrizing function arguments
  • Next by Date: ParallelTable complaining while Table executes
  • Previous by thread: Re: Xcode and command line tools
  • Next by thread: Re: how does Rotate in 2D work?