Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

I have a 3D line vector with end points x0 and x1, which lies along the x-axis of a subsection of the plane, P.

However P has been translated, rotated and translated back from the global coordinate system by theta degrees along the global x-axis. The following image should illustrate my point.

enter image description here

I need to rotate my 3D line vector by a known angle theta to find the line between x0 and x2.

Can this be done by a set of transformation matrices (i.e. translate, x-rotate to global xy-plane, z-rotate by theta then x-rotate and translate back)?

If so, how do I do this? I know the 3D vector equation is as below, but I'm not sure how to integrate that into the transformation.

enter image description here

UPDATE:

Thanks for the answers guys. I apologise for not making myself clear - my head's got in a bit of a muddle with all this!

So I have a world system as in the 1st image, where the Z-axis faces vertically up. $P$, the red plane section, is defined by it's normal (giving orientation) and it's distance, $d$, from the origin using the equation $$\textbf{n}\cdot\textbf{x} = d$$

$\textbf{n}$ is formed using the rotation of the plane in terms of the global coordinate system. That is, assume that $P$ was flat along the x-y plane, as with the black one. It was translated to the origin, rotated by (e.g.) 25 degrees, then translated back.

The actual problem I'm trying to solve is to simulate an object moving from the first (black) plane onto the 2nd (red). I know the direction and speed of the object's movement on the black plane, but I need to know it on the red. I know $x_0$, this is the objects position at the intersection of the two planes. I can work out $x_1$ by simply taking the unit direction vector from one end of P to the other (call this $l$) and multiplying it by the object's speed: $$x_1 = x_0 + s*l$$

However, my object may not be moving directly up the plane as assumed for $l$. We know the angle it's moving at relative to $l$, call this $\theta$. I need to work out the new vector for that direction, so I can add some multiple of it to $x_0$.

share|improve this question
    
I really do not understand what is asked here. Start by explaining what the world coordinate system look like, how is P defined, are $X_0$ and $X_1$ known in what coordinate system? –  ja72 Jul 11 '12 at 16:40
    
Why can't you take the coordinates of $X_1$ and multiply by a rotation about the local $x$-axis? –  ja72 Jul 11 '12 at 16:41
    
You need a Given's rotation around the $x$-$z$ pane. See @ja72's answer below. –  copper.hat Jul 11 '12 at 17:15

2 Answers 2

up vote 0 down vote accepted

Is this what you want?

$$\left(\begin{matrix} x \\ y \\ z \end{matrix}\right) = \left(\begin{matrix} 0 \\ a \\ 0 \end{matrix}\right) + \left(\begin{matrix} 0 \\ a\,(\cos(\theta)-1) \\ a\,\sin(\theta) \end{matrix}\right)\;t $$

where $X_2$ lies on the $y$-axis a distance $a$ from $X_0$.

How?

A point on the line is defined by the origin

$$\vec{X}_2 = \left(\begin{matrix} 0 \\ a \\ 0 \end{matrix}\right) $$

and point

$$\vec{X}_1 = {\rm Rx}(\theta) \vec{X}_2 $$

to give the equation:

$$\vec{r} = \vec{X}_2 + \left( {\rm Rx}(\theta) \vec{X}_2-\vec{X}_2 \right)\; t $$

with

$$ {\rm Rx}(\theta) = \left(\begin{matrix} 1 & 0 & 0 \\ 0 & \cos\theta & -\sin\theta \\ 0 & \sin\theta & \cos\theta \end{matrix}\right) $$

share|improve this answer
    
Thanks for your help, this wasn't quite what I did in the end, but it did inspire it so I've marked it as the answer. –  ianhales Jul 13 '12 at 10:36

Let the line segment from $x_0$ to $x_1$ have direction ratios $(a,b,c)$. Translate the setup by translating $x_0$ to the origin.

By the relation between inner product, norm, and angle between vectors we have

$$\frac{ax+by+cz}{x^2+y^2+z^2}=\cos\phi$$

But since we need to rotate and not scale, we have to get a norm 1 vector So here we go.

$$ax+by+cz=\cos\phi$$ and $x^2+y^2+z^2=1$

Solve this system and get a vector $v$ (make sure it's in $P$ by bringing in the equation of $P$!) of norm $1$.

Then your $x_2$ is just $x_0+v$

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.