Results 1 to 1 of 1

Thread: How to transform multiple 3d points by different distances with a matix calculation?

  1. #1
    Senior Member
    Joined
    Sep 2009
    Posts
    305

    Exclamation How to transform multiple 3d points by different distances with a matix calculation?

    If I have a 3d point $(x,y,z)$ and I want to translate it by a vector $v$, I can just multiply it by a matrix as shown here

    https://en.wikipedia.org/wiki/Translation_(geometry)

    Also I know that if I want to translate n points at the same time, I can just combine it into

    $
    \begin{bmatrix}
    1 & 0 & 0 & v_x \\
    0 & 1 & 0 & v_y \\
    0 & 0 & 1 & v_z \\
    0 & 0 & 0 & 1
    \end{bmatrix}
    \begin{bmatrix}
    x_1 & x_2 & \dots & x_n \\
    y_1 & y_2 & \dots & y_n \\
    z_1 & z_2 & \dots & z_n \\
    1 & 1 & \dots & 1
    \end{bmatrix}
    =
    \begin{bmatrix}
    x_1' & x_2' & \dots & x_n' \\
    y_1' & y_2' & \dots & y_n' \\
    z_1' & z_2' & \dots & z_n' \\
    1 & 1 & \dots & 1
    \end{bmatrix}
    $

    But what if I want to translate n points, but each points moves by a different distance/vector. Is there a way to combine all the calculations in the least amount of matrix calculations so that I can feed it into the GPU to compute faster?

    Does anyone know?

    Thanks



    **EDIT**

    I can see 1 way, but does anyone know if there is a better way. This one seems to increase size of the matrix linearly by a factor of 4 for each point.
    $
    \begin{bmatrix}
    1 & 0 & 0 & v_{x1} & 0 & 0 & 0 & 0 \\
    0 & 1 & 0 & v_{y1} & 0 & 0 & 0 & 0 \\
    0 & 0 & 1 & v_{z1} & 0 & 0 & 0 & 0 \\
    0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 \\
    0 & 0 & 0 & 0 & 1 & 0 & 0 & v_{x2} \\
    0 & 0 & 0 & 0 & 0 & 1 & 0 & v_{y2} \\
    0 & 0 & 0 & 0 & 0 & 0 & 1 & v_{z2} \\
    0 & 0 & 0 & 0 & 0 & 0 & 0 & 1
    \end{bmatrix}
    \begin{bmatrix}
    x_1 & 0 \\
    y_1 & 0 \\
    z_1 & 0 \\
    1 & 0 \\
    0 & x_2 \\
    0 & y_2 \\
    0 & z_2 \\
    0 & 1 \\
    \end{bmatrix}
    =
    \begin{bmatrix}
    x_1' & 0 \\
    y_1' & 0 \\
    z_1' & 0 \\
    1 & 0 \\
    0 & x_2' \\
    0 & y_2' \\
    0 & z_2' \\
    0 & 1 \\
    \end{bmatrix}
    $
    Last edited by Sneaky; Feb 21st 2017 at 02:31 PM.
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. Fourier transform - application, integral calculation
    Posted in the Differential Geometry Forum
    Replies: 3
    Last Post: Nov 16th 2011, 11:40 AM
  2. Multiple linear regression calculation
    Posted in the Advanced Algebra Forum
    Replies: 5
    Last Post: Feb 12th 2010, 01:47 PM
  3. Replies: 2
    Last Post: Jan 7th 2010, 04:19 PM
  4. Solving 3D matix equation
    Posted in the Differential Equations Forum
    Replies: 1
    Last Post: Jul 24th 2009, 02:03 AM

Search Tags


/mathhelpforum @mathhelpforum