# Vector intersecting other vectors in a specific manner

1. Jul 13, 2012

### HKragh

Hi. I'm new here, first post. I hope I do it correctly :)

I'm trying to solve a specific problem, which I need solved for a programming task. Now, my first approach was to iterate a solution which was close enough within some error boundaries I defined. But... it needs to be done correctly, if it can.

So, I have made an illustration of the problem below. I hope it makes sense. And I would be very happy, if a method of directly solving this, exists! And as it seems only one solution is possible, it would make sense to have one formula with the answer.

Just to make sure this is understandable: I have three vectors in 3D space of nonimportant length, extending from origin. These three vectors will be coplanar, and because of this, a fourth vector, hitting them all, is possible. I need this vector to cross the three vectors in a way, which makes the intersection points have equal distances. Is this possible to solve directly, or do I need to iterate a solution? At which distance from origin this intersection takes place, is of no importance!

I normally just LOVE to dig out an answer myself, but this one I have no idea where to begin. I hope someone is capeable of solving this for me...

2. Jul 13, 2012

### micromass

We can solve this by analytic geometry.

First of all, we notice that this is a 2D-problem as everything is coplanar.

Second of all, I will not assume that any line is parallel to the y-axis. You should make the necessary adjustments to cope with this.

So, let the line generated by a (resp b, c) have the form $y=\alpha x$ (resp. $y=\beta x$, $y=\gamma x$.

Pick an arbitrary point on the line generated by a. This point has the form $(x_0,\alpha x_0)$. A line through this point is given by

$$y-\alpha x_0=\epsilon (x-x_0)$$

with $\epsilon$ an parameter.

Now, what you do is find the intersection of that line with b and c. Then express that the distances have the same length.

3. Jul 13, 2012

### haruspex

Drop a perpendicular (vector v) from O to d. Let the angles between the lines ab, bc, cv be α, β, θ respectively. You can derive α and β from the dot products. Based on the distances between points of intersection with d, you can write an equation involving tangents of the three angles (and nothing else). Solve for θ.

4. Jul 14, 2012

### HKragh

Thx. for the replies, guys. I need to make VERY clear, that I'm not educated in anything math related, so the language you´re using, while probably simple within these forums, is very alien to me. But... that´s a good thing! But even though I´m not trained in the language, I do have a good intuition about the subject. So this is what I get from your replies:

micromass:
I will look into your solution. At the moment I first need to find out how I plot vectors in 3d space into a 2d space. Even though they are coplanar to themselves, they are in no way coplanar to the axis' of the 3D space they exist in... It may be trivial to do, but I need to research that first. My intuition tells me I can just pick the up axis along with either of the other (as long as as this is the same for all three), and then solve for that. And when done, project the new line back onto the three lines, perpedicular to the axis of my 2D system. So...I´ll be back, when I have a clue what your solution offers :)

haruspex:
How do I drop a perpendicular line to a vector which I have no idea of? Maybe I misunderstand your solution (maybe you drop this v vector in some hypothetical way, which I don't get ;)).

Thx again. Some day I will indeed take some course to make sure I understand the terminology of math, it's a constant blocker for me, especially when trying to understand the math of some paper. I'm looking forward to being part of this community, and learn.

5. Jul 14, 2012

### haruspex

Yes, you just imagine having done so. The equation you should get is
tan(α+β+θ) + tan(θ) = 2 tan(β+θ)
This reduces to tan(θ) = (B-A-2AB2)/(B(A+B)) where A = tan(α), B = tan(β).
You can get α and β from cos(α) = $\vec{a}$.$\vec{b}$, cos(β) = $\vec{b}$.$\vec{c}$, if $\vec{a}$, $\vec{b}$ and $\vec{c}$ are unit vectors.
Having found θ, the angle between $\vec{c}$ and $\vec{d}$ is π/2-θ.

6. Jul 14, 2012

### HKragh

Haruspex: That actually sounds very straight forward to implement. And yes, a,b and c are indeed unit vectors, so it will be very easy getting the angles. Though getting the angle had they not been unit vectors, is as well very easy in the environment (3D engine) I work in. I'll get back, and tell you about my succees, if the method works as intended.
Thank you so much!

7. Jul 14, 2012

### HKragh

UPDATE: It works perfectly, thank you very much for your help. Next step is understanding fully, why it works, which I haven't yet gone through.