Jump to content
Sign in to follow this  
John Rostron

Rotating a Document using Equations in Photo

Recommended Posts

Many options for rotation in Affinity Photo are constrained to simple fractions of a circle, with 15 degrees being the smallest. It is possible to rotate by an arbitrary angle using the Crop tool. You place the cursor just outside a corner, and rotate by dragging the two-arrowed cursor that appears.

This tutorial explains how you can rotate an image using Filter > Distort > Equations. Before rotation you would normally want to expand the canvas so that you can give the document enough room to rotate. The new canvas width should be at least 150% of the existing diagonal and the Anchor should be in the centre of the array of nine positions. See this image:

5aad6665a7b4e_ResizeCanvas.png.30cca83051de6e133b2010e6394e2fdd.pngq

Now select Filter > Distort > Equations. The top pair of buttons allow you to choose the co-ordinate system. The default is Cartesian (the usual x and y axes). You  need to choose the Polar option. You now have two lines:

r=r
t=t

The r represents the radius (the distance of a point from the centre of the image), and the t (or Theta) is the angle of rotation in radians.Radians are a measure based on pi, You can easily express an angle in radians as a multiple of pi, so 2*pi represents the entire 360 degree rotation, pi represents a half-circle rotation (180 degrees) and pi/4 represents a quarter of a half circle, or  45 degrees. So, writing t=t+pi/2  rotates the image  by a quarter of a circle counter-clockwise. Entering t=t-pi*0.333 rotates it by a sixth of a circle clockwise.

Equations.png.9f6cc4c5ff9cca537ef8f033873a884d.png

So, given a grid like this (after resizing the canvas):

Resized.png.3fee61cfef46f2af06226ef4af061fb9.png

and  using the equations as above, gives an image like this:

Rotated.png.b71d875b81bc8f2b19ab65439eadb3ad.png

which can then be clipped  (Document > Clip Canvas) to give:

Clipped.png.b46f66c5447b6dc434034322d9b21de4.png.

I have created a macro with a single parameter a which represents the fraction of pi. The default value of 1 will not rotate the image. Increasing a will give progressively more rotation; a value of 0.5 will rotate by a half-circle. In the example here, I have resized the canvas before applying the macro. The formula used in this macro is: t=t+pi*2*a.

MacroInAction.png.e1e5fcd35ea25a642039b2a9a9b5ad28.png

Here is the macro: Rotate.afmacro

John

 

 

 


Windows 10, Affinity Photo 1.8,5 Designer 1.8.5 and Publisher 1.8.5 (mainly Photo), now ex-Adobe CC

CPU: AMD A6-3670. RAM: 16 GB DDR3 @ 666MHz, Graphics: 2047MB NVIDIA GeForce GT 630

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...

Important Information

Please note the Annual Company Closure section in the Terms of Use. These are the Terms of Use you will be asked to agree to if you join the forum. | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.