How can I use matrix algebra to rotate a polygon and calculate new coordinates?

  • Context: Undergrad 
  • Thread starter Thread starter thetexan
  • Start date Start date
  • Tags Tags
    Polygon Rotate
Click For Summary

Discussion Overview

The discussion focuses on using matrix algebra to rotate a polygon and calculate the new coordinates of its vertices. Participants explore the mathematical principles behind rotation, particularly in the context of irregular polygons and the implications of isometric transformations.

Discussion Character

  • Exploratory
  • Technical explanation
  • Conceptual clarification
  • Debate/contested
  • Mathematical reasoning

Main Points Raised

  • One participant inquires about rotating a polygon with 5 vertices by 25 degrees clockwise and whether matrix algebra is involved.
  • Another suggests shifting the polygon's center to the origin for easier calculations and mentions that rotation can be represented by a 2x2 matrix.
  • A participant provides the rotation matrix for a clockwise rotation and describes how to apply it to the original coordinates.
  • Some participants express their lack of experience with matrix math but show willingness to learn, seeking clarification on determining the center of rotation for complex polygons.
  • There is a discussion about the definition of a "complex poly," with one participant explaining it refers to irregular polygons with many sides.
  • One participant describes their algorithm for identifying the outermost points of a polygon and their need for a method to rotate the polygon and calculate new coordinates.
  • Another participant notes that rotation is an isometric transformation, which preserves distances between points, and questions the meaning of "measurement" in this context.

Areas of Agreement / Disagreement

Participants express varying levels of understanding regarding matrix algebra and its application to polygon rotation. There is no consensus on the best method for determining the center of rotation for irregular polygons, and the discussion remains unresolved regarding the specifics of the rotation process.

Contextual Notes

Participants mention the need for clarification on mathematical concepts and the application of matrix transformations, indicating potential limitations in their understanding of the underlying principles.

thetexan
Messages
269
Reaction score
13
Let's say I have a 5 vertex polygon drawn on a x/y graph. Each of those vertices have an x/y coordinate.

Now let's say I want to rotate the polygon 25 degrees clockwise and calculate the new coordinates of each vertex.

How can I do that so that by knowing the original coordinate I can do a math transformation and know the resulting coordinate?

Is matrix algebra involved? Is there a simple way that a math challenged guy like me can understand?

Tex
 
Physics news on Phys.org
Shift everything so that the center is your origin.
Counterclockwise rotation of a point (x;y) is the same as multiplication by a 2x2 matrix.
 
Assume the center is the origin.

A rotation of ##\theta## radians clockwise is given by the matrix

\left(\begin{array}{cc} \cos(\theta) & -\sin(\theta)\\ \sin(\theta) & \cos(\theta)\end{array}\right)

Thus if you have the original coordinates ##(x,y)##, then after the rotation, you have the coordinates (written in a column)

\left(\begin{array}{cc} \cos(\theta) & -\sin(\theta)\\ \sin(\theta) & \cos(\theta)\end{array}\right)\left(\begin{array}{c} x\\ y\end{array}\right)
 
  • Like
Likes   Reactions: aikismos
I have no experience or education in matrix math but I"m willing to learn.

Do you mean to put the center of the polygon at the x/y origin? How do I determine where that is if it is a complex poly?
And do I multiply the 2x2 matrix by the 1x2 xy matrix?

tex
 
thetexan said:
I have no experience or education in matrix math but I"m willing to learn.

Do you mean to put the center of the polygon at the x/y origin? How do I determine where that is if it is a complex poly?

Are you not working with a regular polygon? If not: which point is the center of rotation.

And do I multiply the 2x2 matrix by the 1x2 xy matrix?

If the center of rotation is ##(0,0)## and ##(x,y)## are the old coordinates, then the new coordinates are
(x\cos(\theta) - y\sin(\theta), x\sin(\theta) + y\cos(\theta))
 
What do you mean by a "complex poly"?
 
I mean a polygon that has many sides and is irregular in shape. I am working on an algorithm that will determine which points of the polygon are the outermost. By that I mean if I were to redraw a fence aroung the outer most points it would encompass all point including the ones inside of that. Anyway...my way of doing determining which points those are is to rotate the polygon twice and remeasure the extreme points.

So I just need to know a good method (that I can understand) to do the rotation. I want to take the polygon and measure it in its original position, then rotate it 120 degrees and measure it again, and do that one more time.

So it seems that all I have to do is to put the point of rotation within the polygon, note the coordinates of each vertex in that orientation then rotate about that center point 120 degrees. I can do that. I am just wondering if there is a mathematical way (such as matrix math, on which I will need some help) that will mathematically rotate the polygon and produce the new coordinates.

tex
 
thetexan said:
I mean a polygon that has many sides and is irregular in shape. I am working on an algorithm that will determine which points of the polygon are the outermost. By that I mean if I were to redraw a fence aroung the outer most points it would encompass all point including the ones inside of that. Anyway...my way of doing determining which points those are is to rotate the polygon twice and remeasure the extreme points.

So I just need to know a good method (that I can understand) to do the rotation. I want to take the polygon and measure it in its original position, then rotate it 120 degrees and measure it again, and do that one more time.

So it seems that all I have to do is to put the point of rotation within the polygon, note the coordinates of each vertex in that orientation then rotate about that center point 120 degrees. I can do that. I am just wondering if there is a mathematical way (such as matrix math, on which I will need some help) that will mathematically rotate the polygon and produce the new coordinates.

tex

For Euclidean geometry, rotation is an isometric transformation. The distances between points is preserved. I do not understand what "measurement" of the polygon means. Based on isometry, I expect that you would get the same result for each rotation.
 

Similar threads

  • · Replies 1 ·
Replies
1
Views
4K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 7 ·
Replies
7
Views
3K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 6 ·
Replies
6
Views
3K
  • · Replies 5 ·
Replies
5
Views
3K