Transforming a 3D vector using matrix

  • Context: Undergrad 
  • Thread starter Thread starter Gajan
  • Start date Start date
  • Tags Tags
    3d Matrix Vector
Click For Summary

Discussion Overview

The discussion revolves around transforming a 3D vector using a 4x4 transformation matrix that incorporates both rotation and translation. Participants explore the feasibility of transforming a vector directly without first transforming the individual points that define it.

Discussion Character

  • Technical explanation
  • Conceptual clarification
  • Exploratory

Main Points Raised

  • One participant, Gajan, describes a method for constructing a vector AB from points A and B in 3D and seeks to transform this vector directly using a transformation matrix.
  • Another participant explains the use of a 4x4 matrix in projective space for combining rotation and translation, providing specific matrix forms for different scenarios (pure translation and pure rotation).
  • Gajan inquires about the application of the transformation matrix when represented in a transposed form, asking if the matrix product remains valid in this case.
  • A later reply confirms that the convention of writing the vector as a row matrix is acceptable and that the transformation process remains consistent regardless of the representation.

Areas of Agreement / Disagreement

Participants generally agree on the mathematical principles involved in using a 4x4 transformation matrix, but there is no consensus on the best approach to directly transform the vector AB without transforming the individual points A and B first.

Contextual Notes

The discussion does not resolve the specific computational method for transforming the vector AB directly, and assumptions about the representation of vectors and matrices are acknowledged but not fully explored.

Gajan
Messages
3
Reaction score
0
Hi Friends,

I have a problem in transforming a vector in 3d using a matrix.

I have two points A, B. Assume origin is O, here A,B ,O are in 3d.

First construct a vector AB:

OB = OA + AB
AB = OB - OA
AB = OB + AO

I have a 4*4 matrix that gives the transformation matrix(rotation+translation)

I need to transform vector AB using this matrix.

Currently what I do is transform individual points A , B first and the reconstruct the vector A'B' again (after tranforming)
What I want to do is to without doing the above steps, transform the vector as it is (without transforming the individual points). Is this possible?

How could I do this computation?

I am looking for your reply!

thank you.

/Gajan
 
Physics news on Phys.org
Using a single 4x4 matrix to do both rotation and translation, you have to use a "projective" space. That means you are representing the point (x,y,z) as the (column) vector [x y z 1] with the provision that [a b c d] is the same as [a/d b/d c/d 1] (d can never be 0). In that case the matrix that rotates, say, [itex]\theta[/itex] degrees about the y-axis and translates by (tx,ty, tz) is
[tex]\begin{bmatrix} cos(\theta) & 0 & -sin(\theta) & tx \\ 0 & 1 & 0 & ty \\ sin(\theta) & 0 & cos(\theta) & tz \\ 0 & 0 & 0 & 1\end{bmatrix}[/tex]
Notice that in the particular case of [itex]\theta= 0[/itex] where there is no rotation and so a pure translation, this becomes
[tex]\begin{bmatrix} 1 & 0 & 0 & tx \\ 0 & 1 & 0 & ty \\ 0 & 0 & 1 & tz \\ 0 & 0 & 0 & 1\end{bmatrix}\begin{bmatrix} x \\ y \\ z \\ 1\end{bmatrix}= \begin{bmatrix} x+ tx \\ y+ ty \\ z+ tz \\ 1\end{bmatrix}[/tex]

While if tx= ty= tz= 0 so there is a pure rotation and no translation it is
[tex]\begin{bmatrix} cos(\theta) & 0 & -sin(\theta) & 0 \\ 0 & 1 & 0 & 0 \\ sin(\theta) & 0 & cos(\theta) & 0 \\ 0 & 0 & 0 & 1\end{bmatrix}\begin{bmatrix} x \\ y \\ z \\ 1\end{bmatrix}= \begin{bmatrix} xcos(\theta)- zsin(\theta) \\ y \\ xsin(\theta)+ zcos(\theta)\end{bmatrix}[/tex]

I would handle a general rotation as the product of two rotations around coordinate axes.
 
Hi,

First of all thank you for your reply.

In my case , I have the matrix in the following form:

Transpose matrix of the transformation : M
vector :V

V * M

still is it the same way the matrix product is done?
 
Last edited:
Assuming that you are writing V as a row matrix, yes, swapping "row" and "column" is purely a matter of convention.
 
Thanking you. I understand it now.
 

Similar threads

  • · Replies 12 ·
Replies
12
Views
5K
  • · Replies 7 ·
Replies
7
Views
3K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 20 ·
Replies
20
Views
3K
  • · Replies 1 ·
Replies
1
Views
4K
  • · Replies 24 ·
Replies
24
Views
3K
  • · Replies 33 ·
2
Replies
33
Views
3K
  • · Replies 2 ·
Replies
2
Views
1K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 8 ·
Replies
8
Views
3K