Fast solutions to simple geometry problem

55 Views Asked by At

What is an elegant (read: computation-minimal) solution to the following problem?

Find $v_{\alpha}\in\mathbb{R}^3$ such that the angle between $v_{\alpha}$ and $w=(1, 1, 1)^T$ is $\alpha$.

2

There are 2 best solutions below

0
On

The angle between non-zero vectors $u,w\in\mathbb{R}^3$ is defined by $$\cos\alpha = {u\cdot w\over ||u||\;||w||},$$ where $\cdot$ denotes the dot product in $\mathbb{R}^3$.

In your case, you know the vector $w$ and the angle $\alpha$.

1
On

$w\,\cos\alpha+u\,\sin\alpha$, where $u=\sqrt{3/2}\,(1,0,-1)^T$.
If OP gives some context, I may add details, but without that I can't know which details they need. It's just one solution out of infinitely many, so I wonder why it wouldn't matter which one you get.