Two-dimensional rotations come up often in digital image production and game programming. As objects move around in a virtual world they can both translate, and rotate. In two dimensions, a rotation is defined by an axis, the point about which the rotation takes place, and the angle of rotation. To rotate a triangle, you rotate the three vertices that define the triangle.
Triangle in the Grid
Points on a two-dimensional grid are written (x, y). A triangle has three such points, one defining each vertex. For instance, we could label these p1 = (x1, y1), p2 = (x2, y2) and p3 = (x3, y3).
Rotations around the Origin
If you rotate a point p by an angle θ, you get a new point p’ = (x’, y’) where x’ = x∙cos(θ) - y∙sin(θ) and y’ = y∙cos(θ) + x∙sin(θ). To rotate a triangle, you apply this process to p1, p2 and p3.
Rotations around an Arbitrary Axis
To rotate around an arbitrary axis, you translate the axis to the origin, taking the point p with it, perform the rotation as above, then undo the translation. Let P = (X, Y) be the axis. Translate both the axis and the point to the origin by subtracting P. This gives a new axis, P = P - P = (0, 0), and a new point p = (x, y) = p-P = (x - X, y - Y). Perform the rotation as usual on p. Finally, undo the initial translation by adding P to get x’ = X + (x - X)∙cos(θ) - (y - Y)∙sin(θ) and y’ = Y + (y - Y)∙cos(θ) + (x - X)∙sin(θ). Repeat this process for each point.
Let a triangle be defined by the points p1 = (1,1), p2 = (2,3) and p3 = (4,2). Rotate the triangle around the point P = (3,-1) by 23 degrees. Using the formula, p1 - P = (-2,2) and p1’_x = 3 + (-2)∙cos(23) - 2∙sin(23) = 0.3775, and p1’_y = -1 + 2∙cos(23) + (-2)∙sin(23) = 0.0595. Transforming the other points in a similar way, we have the new points: p1’ = (0.3775, 0.0595), p2’ = (0.5166, 2.2913) and p3’ = (2.7483, 2.1522).
- Photo Credit Dario Lo Presti/iStock/Getty Images
How to Solve Rotation Maths
A common problem within geometry involves rotating a shape -- described by a set of points -- about the origin by a...
How to Rotate an MP4 Video 90 Degrees
MPEG 4 is a video format that has revolutionized the digital distribution of video. Its small size and high quality even made...
How to Rotate Text 90 Degrees on Microsoft Word Processing
Word 2013 under Windows 7 or 8.1 allows you to rotate a section of text at a 90 degree angle while keeping...
How to Teach Transformations for Math
In geometry, transformations relate to the movement of figures on a plane. Teach students the procedures of various transformations by practicing them,...
How to Rotate a Table by 90 Degrees in OpenOffice Writer
Tables help to organize data within documents. They can be effective compliments to the text in your documents, but can also stand...
How to Make a Tessellation From a Triangle
Tessellation is a unique form of geometrical art that allows artists to create tiled or patterned masterpieces simply by repeating one or...
Do Triangles Tessellate?
Before you can find out whether or not triangles tesselate, you must first understand what that term means. Find out if triangles...
Yoga: Triangle Post to the Left
In yoga, the triangle pose is performed by lifting the rib cage and rotating the left foot 90 degrees. Perform the triangle...