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 Rotate an MP4 Video 90 Degrees
Select "Left by 90" to rotate the video 90 degrees counter-clockwise. Select "Right by 90" to rotate the video 90 degrees clockwise.
Do Triangles Tessellate?
There's a simple trick that you can do by rotating a triangle around any of its sides, you can create a parallelogram....
How to Solve Rotation Maths
This method yields the figure that is a 90 degree rotation about the origin from the original. 3. ... How to Rotate...
How to Rotate Text 90 Degrees on Microsoft Word Processing
Rotating text in Microsoft Word requires that text be inside a text box. The default setup for Microsoft Word is no text...
How to Teach Transformations for Math
Teaching transformations requires providing students with the necessary vocabulary to explain the movement of shapes on a grid. ... a rotation occurs...
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...
How to Make a Tessellation From a Triangle
Although triangles are generally difficult to tessellate due to their uneven sides, ... Trace the triangle tile after each rotation. Once you...
How to Rotate a Table by 90 Degrees in OpenOffice Writer
How to Rotate a Table by 90 Degrees in OpenOffice Writer. Tables help to organize data within documents. ... Your table will...