Finding a Linear Transform for Contraction of Vectors

In summary, this person is trying to find a linear transform that will take a vector (x, y, z) and output a vector scaled in the direction of another vector. They are using a matrix (A, B, C) to rotate the vector vx, vy, vz, and scale the x dimension, but they are not getting anywhere because the matrix is not symmetric. They eventually realize that they need to use an orthogonal matrix to do the job.
  • #1
MikeLizzi
239
6
Hi folks,

This is my first post here. I hope this is the right forum for this question.

I am trying to come up with a linear transform to that will take as input a vector (x, y, z) and output a vector that is scaled in the direction of another vector.

For example:
Suppose I have the corners of a square defined by the four vectors
(4, 4, 0)
(-4, 4, 0)
(-4, -4, 0)
(4, -4, 0)

I want to scale those vectors by 50% in the direction specified by the vector < 1, 1, 0 >

I want to end up with the four vectors
(2, 2, 0)
(-4, 4, 0)
(-2, -2, 0)
(4, -4, 0)

The initial square has been “squashed” by 50% in the northeast/southwest direction.
Can anybody come up with a transform for that?
 
Physics news on Phys.org
  • #2
So you want a matrix of the form
[tex]\begin{pmatrix}a & b & c \\ d & e & f \\ g & h & i\end{pmatrix}[/tex]
such that
[tex]\begin{pmatrix}a & b & c \\ d & e & f \\ g & h & i\end{pmatrix}\begin{pmatrix}4 \\ 4 \\ 0\end{pmatrix}= \begin{pmatrix}2 \\ 2 \\ 0\end{pmatrix}[/tex]
That gives the three equations 4a+ 4b= 2, 4d+ 4e= 2, and 4g+ 4h= 0.

You also want
[tex]\begin{pmatrix}a & b & c \\ d & e & f \\ g & h & i\end{pmatrix}\begin{pmatrix}-4 \\ 4 \\ 0\end{pmatrix}= \begin{pmatrix}-4 \\ 4 \\ 0\end{pmatrix}[/tex]
That gives the three equations -4a+ 4b= -4, -4d+ 4e= 4, -4g+ 4h= 0.

Doing the same with the other two points will give you a total of twelve equations for the 9 values, a, b, c, d, e, f, g, h, and i. But I think you will find the last three redundant. Once you have the first three points, the requirement that the figure be a parallelogram fixes the fourth.
 
Last edited by a moderator:
  • #3
Thank you HallsofIvy.

But I’m looking for a formula that will convert any vector. I will be using this formula in a computer program that will contract any shape by any amount in any direction.
This is my current strategy:

For any given point (x, y, z), direction vector (vx, vy, vz) and scale g;
Rotate the point so that its x-axis lines up with the direction vector.
That means two separate rotations for a point in 3d.
Then multiply the x value by the scale.
Then back out the two rotations in reverse order.

I built the following:
Matrix A rotates the point about the Z-axis
Matrix B rotates the point about the X-axis
Matrix C scales only the x dimension.
Matrix D is the inverse of B
Matrix E is the inverse of A

So if P (x, y, z) is the input and P’ (x’, y’, z’) is the output I have
P’ = [E][D][C][A]P
Unfortunately, the strategy is not working.
 
  • #4
So you want a matrix T that scales by a factor of g along the vector v, while leaving everything orthogonal to v fixed. That is, Tv = gv, and Tu = u for all u orthogonal to v. You now have the eigenvalues and eigenspaces of T. Since the eigenspaces are orthogonal, to find T all you need is an orthogonal matrix Q such that Qv is on the first coordinate (x) axis; then you'll have T = QTDQ, where D = diag(g, 1, ..., 1) is the diagonal matrix of eigenvalues.

Observe that since your eigenvalues are real and eigenspaces are orthogonal, T will be a symmetric matrix.
 
  • #5
adriank said:
So you want a matrix T that scales by a factor of g along the vector v, while leaving everything orthogonal to v fixed. That is, Tv = gv, and Tu = u for all u orthogonal to v. You now have the eigenvalues and eigenspaces of T. Since the eigenspaces are orthogonal, to find T all you need is an orthogonal matrix Q such that Qv is on the first coordinate (x) axis; then you'll have T = QTDQ, where D = diag(g, 1, ..., 1) is the diagonal matrix of eigenvalues.

Observe that since your eigenvalues are real and eigenspaces are orthogonal, T will be a symmetric matrix.

This sounds great, adriank, but what does Q look like? I'm thinking it has to be a transform that rotates v into the x-axis. And the inverse of Q would rotate it back. I got something that works when u and v are two dimensional vectors.

But my three dimensional attempt fails.
 
  • #6
I think I got it!

My problem was more to do with the syntax of the programming language.

Thank you all.
 

1. What is a linear transform for contraction of vectors?

A linear transform for contraction of vectors is a mathematical operation that involves transforming a vector in such a way that its length decreases while its direction remains the same. This is commonly used in physics and engineering to represent the compression or contraction of an object in a specific direction.

2. How is a linear transform for contraction of vectors different from other types of transformations?

A linear transform for contraction of vectors is different from other types of transformations, such as rotations or reflections, in that it only affects the length of the vector and not its direction. This makes it a useful tool for representing changes in scale or size.

3. What are some real-world applications of linear transforms for contraction of vectors?

Linear transforms for contraction of vectors have many applications in physics and engineering. They are used to represent the compression of springs, the contraction of muscles, and the decrease in size of objects due to temperature changes. They are also used in computer graphics to create 3D models that change in size or scale.

4. How do you find the linear transform for contraction of vectors?

To find the linear transform for contraction of vectors, you need to know the initial and final lengths of the vector, as well as the direction in which the contraction is occurring. You can then use mathematical equations, such as the formula for scaling, to determine the appropriate transformation matrix.

5. Can a linear transform for contraction of vectors be applied to vectors in any dimension?

Yes, a linear transform for contraction of vectors can be applied to vectors in any dimension. The principles and equations used to calculate the transformation remain the same regardless of the number of dimensions. However, the resulting transformation matrix will vary depending on the dimensionality of the vector.

Similar threads

  • Linear and Abstract Algebra
Replies
4
Views
1K
  • Linear and Abstract Algebra
Replies
4
Views
2K
  • Linear and Abstract Algebra
Replies
10
Views
2K
  • Linear and Abstract Algebra
Replies
4
Views
2K
  • Linear and Abstract Algebra
2
Replies
52
Views
2K
  • Linear and Abstract Algebra
Replies
2
Views
973
  • Linear and Abstract Algebra
Replies
5
Views
1K
  • Linear and Abstract Algebra
Replies
20
Views
3K
  • Linear and Abstract Algebra
2
Replies
43
Views
5K
  • Linear and Abstract Algebra
Replies
10
Views
1K
Back
Top