![](/profiles/wavemetrics/themes/wavemetrics/logo.png)
rotate an image
![](/sites/default/files/styles/thumbnail/public/default_images/Artboard%201_1.png?itok=jeHOCIXy)
anna
I have two questions for whoever can help me... I have been searching in the forum and I think that there is no easy solution to my problem, but I will ask anyway. Here are my doubts:
- I have an image made up by a 2D crystal lattice points (see image attached). I would like to rotate the lattice, the points, about the origin at an angle that I decide, which can change. Is there an easy way to do it?
- I would like to 'mirror' the same image not about an axis, but about a line that passes through the origin at, say, 30º, and I would like to be able to change the angle of this mirroring line... Is this possible?
Thanks a lot in advance!
![example.jpg](/sites/default/files/styles/content_body/public/images-imported/example_0.preview.jpg?itok=Gi8MwyMh)
No doubt there'll be an inbuilt transform to do the same thing.
Wrt to the mirroring, that should be straightforward as well.
March 21, 2011 at 06:08 am - Permalink
http://en.wikipedia.org/wiki/Molecular_symmetry
.. and equivalent hard copy resources. Once you express your lattice as a [x, y] vector matrix, on hand the proper matrix operation, you can do any form of symmetry operation you want using the MatrixOp abilities in Igor Pro.
--
J. J. Weimer
Chemistry / Chemical & Materials Engineering, UAHuntsville
March 21, 2011 at 05:30 pm - Permalink
Try this. It performs "unitful" rotations (i.e., respecting the x and y scaling) about (0,0). If you want to rotate about a different point, just shift your origin. The output is returned as M_rotated2D. The optional useInterp parameter alters how "jagged" the output is. Try it both ways just to see what I mean.
By the way, the output is automatically resized to preserve the number of points along each edge. The space around your image will just be set to NaN.
Good luck,
Nick
March 22, 2011 at 10:23 am - Permalink