0
$\begingroup$

How do you write each condition as an equation or inequality to find a vector $v$ that satisfies

$v$ is a unit vector: $||v||=1$, $v$ forms an angle of π/3 with the vector $(6,4,-2)$, $v$ is orthogonal to the vector $(3,-4,7)$, the third component of $v$ is positive.

$\endgroup$
3
  • $\begingroup$ What have you tried so far? Some useful functions would be VectorAngle and Norm. $\endgroup$ Apr 16, 2018 at 16:53
  • $\begingroup$ {v1, v2, v3} /. Solve[{Norm[{v1, v2, v3}] == 1, {v1, v2, v3}.{6, 4, -2}/ Norm[{6, 4, -2}] == Cos[Pi/3], {v1, v2, v3}.{3, -4, 7} == 0, v3 > 0}, {v1, v2, v3}] // Simplify $\endgroup$
    – Artes
    Apr 16, 2018 at 17:01
  • $\begingroup$ For example for condition 3, v is unknown while u= {6,4,-2}, If I use VectorAngle[u, v]*Pi/3 // N, how will the function find v (I get an error)? I am having trouble understanding how vector angle works. Apparently, it's easier than using the function of dot product of two vectors. $\endgroup$
    – mastud89
    Apr 16, 2018 at 17:06

1 Answer 1

3
$\begingroup$

Something like this:

vec = {x, y, z};
v1 = {3, -4, 7};
v2 = {6, 4, -2};

eqs = {Norm[vec] == 1, vec.v1 == 0, vec.(v2/Norm[v2]) == Cos[Pi/3], z > 0};

Solve[eqs, {x, y, z}] // N

(* {{x -> 0.176786, y -> 0.885294, z -> 0.430117}} *)
$\endgroup$
1
  • $\begingroup$ Ah, I forgot that you can put all conditions in one line like when you are solving for the roots of specific equations(s) and then solve. $\endgroup$
    – mastud89
    Apr 16, 2018 at 17:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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