1
$\begingroup$

Firstly, I apologize for the very vague title, but I really couldn't figure out how to word it better. I hope my explanation below is a bit more thorough.

Let there be two non-colinear but otherwise arbitrary unit vectors $\vec v_1$ and $\vec v_2$ in $R^3$. There will be a unique plane spanned by these two vectors which passes through the origin. Let the normal vector of this plane be $\vec n$.

Given a third unit vector $\vec u_1$ which is perpendicular to $\vec v_1$ (but not necessarily perpendicular to the plane), find the unit vector $\vec u_2$ which is perpendicular to $\vec v_2$ and is obtained by rotating $\vec v_1$ about the normal $\vec n$ by $\theta$ degrees, where $\theta$ is the angle between $\vec v_1$ and $\vec v_2$ plus the angle between $\vec u_1$ projected onto the plane onto the plane and $\vec v_1$ (the horizontal angle relative to the plane).

In other words, I would like to find the vector $\vec u_2$ which is "relative" to $\vec v_2$ the same amount $\vec u_1$ is "relative" to $\vec v_1$, relative to the plane which $\vec v_1$ and $\vec v_2$ span. If the vector $\vec u_1$ can be thought of as starting from the end of $\vec v_1$, then I would like $\vec u_2$ to point out in the same direction from the end of $\vec v_2$ and be orthogonal to it.

Another way of looking at the problem is that, in the basis formed by $\vec v_1$, $\vec v_2$ and $\vec n$, I would like to find $\vec u_2$ such that it is perpendicular to $\vec v_2$ and forms the same horizontal angle that $\vec u_1$ forms with $\vec v_1$.

As some background to further give insight, vector $\vec v_1$ represents a direction from point $P_1$ to the origin, and vector $\vec v_2$ represents a direction from point $P_2$ to the origin. If one were to orientate a camera so that it pointed in the direction of $\vec v_1$ and tilted it so that the top of its lense top pointed in the direction of $\vec u_1$, how could I move the camera to $\vec v_2$ along the plane so that it looked at the origin in the same orientation (relative to the plane) from $P_2$, and what would the new unit vector $\vec u_2$ from the top of its lense be?

$\endgroup$

1 Answer 1

1
$\begingroup$

tl; dr: Here's a formula (with no arrows over the vectors): $$ u_{2} = (u_{1}\cdot v_{1}) v_{2} + [u_{1}\cdot (n \times v_{1})] (n \times v_{2}) + (u_{1}\cdot n) n. $$ Take care that we have $v_{1}$ in the dot products and $v_{2}$ outside.


Why this works:

Set $n = \frac{v_{1} \times v_{2}}{|v_{1} \times v_{2}|}$. The ordered triple $(v_{1}, n \times v_{1}, n)$ is a positively-oriented orthonormal basis. Decompose $u_{1}$ into components: \begin{align*} u_{1} &= av_{1} + b(n \times v_{1}) + cn \\ &= (u_{1}\cdot v_{1}) v_{1} + [u_{1}\cdot (n \times v_{1})] (n \times v_{1}) + (u_{1}\cdot n) n. \end{align*} (These formulas hold regardless of $u_{1}$. In your situation, $a = 0$ since $v_{1} \perp u_{1}$.) Since rotation about $n$ carries $v_{1}$ to $v_{2}$, it carries $n \times v_{1}$ to $n \times v_{2}$, and therefore carries $u_{1}$ to $$ u_{2} = av_{2} + b(n \times v_{2}) + cn. $$ The formula at the top results from substituting the known values of $a$, $b$, and $c$.

$\endgroup$
4
  • $\begingroup$ Wow, thank you so much! I actually re-asked the question slightly differently because I thought I worded it a bit too complicated in this post, is this answer similar for my new question? I.e. is the question I asked ultimately the same for both? The only difference in the question is for the second one the vectors are not necessarily normalized math.stackexchange.com/questions/4216964/… $\endgroup$
    – Gary Allen
    Aug 4, 2021 at 21:56
  • $\begingroup$ Assuming I've understood your intent, yes, the two questions appear to be "the same". (Given the edit here, however, I have nagging doubts that I've understood your intent. You do want to rotate $u_1$ about $n$ in a way that carries $v_1$ to $v_2$...? :) $\endgroup$ Aug 4, 2021 at 22:00
  • 1
    $\begingroup$ Yes! That's exactly what I want. In the second question, my object is moving from one point to another i.e. it is being carried from $v_1$ to $v_2$, so its normal vector should follow suit. I guess I'll just see if someone else answers my less-wordy question but I think I'll mark your answer as correct! I'm amazed how simple it turned out haha, thank you! $\endgroup$
    – Gary Allen
    Aug 4, 2021 at 22:07
  • 1
    $\begingroup$ it works perfectly! Here's what it helped me implement. Thanks very much! youtu.be/5A-ns6y16UQ $\endgroup$
    – Gary Allen
    Aug 5, 2021 at 0:21

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .