Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2003
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2003

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

Search the Archive

Re: Image Rotation

  • To: mathgroup at smc.vnet.net
  • Subject: [mg39335] Re: Image Rotation
  • From: "Allan Hayes" <hay at haystack.demon.co.uk>
  • Date: Tue, 11 Feb 2003 04:47:20 -0500 (EST)
  • References: <b27fv5$nj3$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

"Ann Fitchard" <mathfit2000 at yahoo.com> wrote in message
news:b27fv5$nj3$1 at smc.vnet.net...
> Mathgroup,
>
> I have an image in the form of nested lists.  I would like to rotate this
image.  In the standard package, I can rotate it 90 degrees at a time.  I
would like to rotate the image by non-specific intervals.  Does anyone know
how I can do this with the standard package.
>
> Thank you for your time.

Ann,

<< "Geometry`Rotations`"

    gr = Show[Graphics[{Hue[0], Polygon[{{0, 0}, {1, 0}, {1, 1}}], Hue[2/3],
Thickness[0.02],
         Line[{{0, 0}, {0, 1}}], PointSize[0.06], Point[{0, 0.5}]}],
AspectRatio -> Automatic]

    grrot = gr /. p:{_?(AtomQ[#1] && Element[#1,Reals] & ), _?(AtomQ[#1] &&
Element[#1,Reals] & )} :>
         Rotate2D[p, Pi/4., {1, 1}];

    Show[grrot, Frame -> True, PlotRange -> All]

1) The rotations of the objects are clockwise.
2) AtomQ is used because for example

    MatchQ[{{{{2, 3}, 5, 6}}}, x_ /; Element[x ,Reals]]

    True

It seems that MatchQ[expr, x_ /; Element[x ,Reals]] is true if it is a
nested list or single atom and all atoms of expr are real ( with head, Real,
Rational or Integer) and no subpart of expr contains two lists.

--
Allan

---------------------
Allan Hayes
Mathematica Training and Consulting
Leicester UK
hay at haystack.demon.co.uk
Voice: +44 (0)116 271 4198
Fax: +44 (0)870 164 0565





  • Prev by Date: Re: Compile message suppression
  • Next by Date: Re: I need some help about this error
  • Previous by thread: Image Rotation
  • Next by thread: Re: Image Rotation