I’ll admit Chronos’s way is simpler than mine. I hadn’t noticed that the OP specified A and B perpendicular, which simplifies things a bit.
Although a similar method works well even for a more general problem:
E.g.: Find a vector X (of magnitude X) such that for two vectors A and B (not scalar multiples of each other), the angle between A and X is phi, and the angle between B and X is theta.
Answer: X = a A + b B + c C, where C = A x B
The coefficients a, b, and c, can be determined as follows:
Let A, B, and C be the magnitudes of A, B, and C
Let D = A dot B
Then:
- A[sup]2[/sup]a + Db = AX cos(phi)
- Da + B[sup]2[/sup]b = BX cos(theta)
- A[sup]2[/sup]a[sup]2[/sup] + B[sup]2[/sup]b[sup]2[/sup] + C[sup]2[/sup]c[sup]2[/sup] = X[sup]2[/sup]
Solve for a and b using 1) and 2), and then solve for c using 3).
For the actual problem specified in the OP, we have phi = 90 degrees, D = 0, and C = AB.
Thus, the above equations reduce to
- a = 0
- Bb = X cos(theta)
- B[sup]2[/sup]b[sup]2[/sup] + A[sup]2[/sup]B[sup]2[/sup]c[sup]2[/sup] = X[sup]2[/sup]
From 2), we have (Bb/X)[sup]2[/sup] = cos[sup]2/sup
Thus, we can rewrite 3) as (AB/X)[sup]2[/sup]c[sup]2[/sup] = 1 - cos[sup]2/sup = sin[sup]2/sup
Thus,
c = (X/AB)sin(theta)
up to an arbitrary sign.
In other words,
X = (X/B) cos(theta)B + (X/AB) sin(theta)C = X [cos(theta) B/B + sin(theta) (A x B)/AB]
For the choice X = B, this is just
X = cos(theta) B + sin(theta) (A x B)/A
as Chronos said.