- #1
Peter5897
- 16
- 0
I've got a computer graphics final coming up and for some reason my brain is crapping out when it comes to, what should be, a simple problem.
I know how to align two arbitrary 3D vectors (axis-angle) but 2D in 2D I'm having trouble remembering how to do it.
On my review sheet it states
In 2D, computer the 3x3 matrix that aligns V = (Vx, Vy) with W = (Wx, Wy)
I suppose the rotation matrix would be a start.
----------------------------
| cos(theta) -sin(theta) 0 |
| sin(theta) cos(theta) 0 |
| 0 0 1 |
---------------------------
I know that theta = arccos(v dot w) but I believe that on a test shoving in an arccos won't be sufficient. IE
--------------------------------------------------
| cos(arccos(v dot w)) -sin(arccos(v dot w)) 0 |
| sin(arccos(v dot w)) cos(arccos(v dot w)) 0 |
| 0 0 1 |
---------------------------------------------------
Pretty gross looking if you ask me.
My question to you is, what am I forgetting? I believe there must be some simple linear algebra theorem that I am currently drawing a blank on, or is this really the best way?
Thanks for any insight you guys could bring,
-Peter
PS, sorry for my awful attempt at making matrices, the formatting seems to change during the submission process.
PPS, probably should have put this in the pre-calc section... whoops.
I know how to align two arbitrary 3D vectors (axis-angle) but 2D in 2D I'm having trouble remembering how to do it.
On my review sheet it states
Homework Statement
In 2D, computer the 3x3 matrix that aligns V = (Vx, Vy) with W = (Wx, Wy)
Homework Equations
I suppose the rotation matrix would be a start.
----------------------------
| cos(theta) -sin(theta) 0 |
| sin(theta) cos(theta) 0 |
| 0 0 1 |
---------------------------
The Attempt at a Solution
I know that theta = arccos(v dot w) but I believe that on a test shoving in an arccos won't be sufficient. IE
--------------------------------------------------
| cos(arccos(v dot w)) -sin(arccos(v dot w)) 0 |
| sin(arccos(v dot w)) cos(arccos(v dot w)) 0 |
| 0 0 1 |
---------------------------------------------------
Pretty gross looking if you ask me.
My question to you is, what am I forgetting? I believe there must be some simple linear algebra theorem that I am currently drawing a blank on, or is this really the best way?
Thanks for any insight you guys could bring,
-Peter
PS, sorry for my awful attempt at making matrices, the formatting seems to change during the submission process.
PPS, probably should have put this in the pre-calc section... whoops.
Last edited: