Extracting overall angle from a matrix

  • Context: Undergrad 
  • Thread starter Thread starter humanchimp
  • Start date Start date
  • Tags Tags
    Angle Matrix
Click For Summary

Discussion Overview

The discussion revolves around determining the overall angle between the horizontal and a line segment (AB) of a square after applying a transformation matrix that includes rotations and translations. Participants explore mathematical approaches to extract this angle, particularly in the context of using Javascript and SVG for graphical representation.

Discussion Character

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

Main Points Raised

  • One participant inquires about calculating the angle between the line AB and the horizontal after applying a transformation matrix, noting the challenge of doing so without knowing the new coordinates of points A and B.
  • Another participant suggests using the inverse tangent of the difference in y-coordinates over the difference in x-coordinates to find the angle, assuming the coordinates are known.
  • A participant expresses uncertainty about the mathematical representation of the transformation, asking for clarification on whether the transformation is applied to the coordinate system or the object itself.
  • Further clarification is provided regarding the transformation process, indicating that the object's coordinate system changes while the base coordinate system remains fixed, creating a nested coordinate system scenario.

Areas of Agreement / Disagreement

Participants do not reach a consensus on how to mathematically determine the angle without knowing the transformed coordinates of points A and B. Multiple views on the transformation process and its implications are presented, indicating ongoing uncertainty.

Contextual Notes

Limitations include the lack of specific coordinates after the transformation and the dependence on understanding the transformation matrix's effects on the coordinate system. The discussion also highlights the potential complexity of visualizing transformations in a nested coordinate system.

humanchimp
Messages
4
Reaction score
0
Hi - was wondering if anyone could help with this problem.

If I have a square, which is like this:
Code:
A-----B
|     |
|     |
C-----D

and I then apply a transform matrix to it, which might consist of multiple rotations and translations, is there any way to determine what the overall angle is between the horizontal and the line AB of the square?

I am assuming there is a way to do this, because it is always possible to just draw out the square with the matrix applied to it, on paper and just measure the angle that it makes to the horizontal with a protractor. However I have no idea how to go about working out the angle purely mathematically.

The matrix I am using is of the form:
[a] [c] [e]
[d] [f]
[0] [0] [1]

I would appreciate any help with this.
Thanks
 
Physics news on Phys.org
You're using an x-y coordinate frame. The angle that AB makes with respect to the x-axis is just the inverse tangent of YAB/XAB, where YAB is the y component of A minus the y component of B.
 
Hi - thanks for the help.

I should say that this is for use with Javascript and SVG.

The problem is that I don't know what the x and y coordinates are of any of the corners once the matrix is applied to it. I know the x and y position of the top left hand corner of the square before the matrix is applied to it, however when you apply the matrix to it, according to the computer, the x and y coordinates of the square stay the same even though the position of the top left hand corner has moved.

So because I don't have the x and y coordinates of the corners A or B I can't use that formula.

Do you have any suggestions on how I could work out the position of A and B just by using the coordinates of the square before the matrix is applied, and the matrix itself?

Sorry if this post isn't very clear.
 
It looks like you're applying a rotation matrix to the components.

i.e.

r'=Mr
where M is your matrix and r is the triplet r=(rx,ry,rz). Is that correct?
 
erm - I'm not really sure what that means - my maths has never been very good.

Maybe this explains it better:
http://www.w3.org/TR/SVG/coords.html
if you search for: "Mathematically, all transformations can be represented as 3x3 transformation matrices of the following form:" without the speech marks that section explains how the matrix system I am using works.

Thanks for your help again.
 
OK.

Are you transforming the coordinate system (x and y axes) or are you transforming the box, whilst keeping the coordinate system fixed?

These are largely equivalent processes, but it would be nice to know which one you're doing.
 
Hi - sorry for the delay in replying. I was expecting to get an email but it never arrived.

When I apply the matrix, the coordinate system of the object is changed to reflect the matrix. So, for example if I rotate the object by 30 degrees, the coordinate system of the object, will rotate 30 degrees. However, the 'base' coordinate system stays the same. So in essence you have a coordinate system within another coordinate system.

If you have a look here: http://www.w3.org/TR/SVG/images/coords/RotateScale.svg [edit] you will need Internet explorer with the Adobe SVG Viewer plugin or just firefox to view that file [/edit] the black lines along the top and left hand side is the 'base' coordinate system, and the red lines are the new coordinate system for each matrix.

So in answer to your question, i am transforming a 'child' coordinate system within a fixed coordinate system.
 

Similar threads

  • · Replies 33 ·
2
Replies
33
Views
3K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 8 ·
Replies
8
Views
3K
  • · Replies 7 ·
Replies
7
Views
4K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 10 ·
Replies
10
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 12 ·
Replies
12
Views
5K
  • · Replies 7 ·
Replies
7
Views
3K