Sign in to follow this  
derek7

how to get the vec according to cos value.

Recommended Posts

given cos of a angle of a vector and a x axis, how to get that vector? if I use dot product to get the cos value,and will have 2 angle related to that cos value. so how to get one of them? simply:a cos have two corresponding a angle.I mean cos(270) = cos(90)

Share this post


Link to post
Share on other sites
You can't get either 1 of 2 vectors from the dot product without knowing one of them.

Even if you know one of the vectors, there is an infinite number of secondary vectors.


ace

Share this post


Link to post
Share on other sites
Ace is right, of course. You might be able to limit the problem if you consider only unit vectors, but you'll still have two solutions for your problem. Then, you'll have to choose which one you'll discard (maybe you'll want only the one which gaves you a positive angle).

If your known vector is [X, Y, Z] (length=1), and the one you want to find is [x y z] then the final answer is the solution of these equations:

x*x + y*y + z*z = 1
x*X + y*Y + z*Z = cos(a)

You'll see that you have 2 equations, and 3 unknowns.

Good luck ;)

Share this post


Link to post
Share on other sites
Quote:
Original post by derek7
given cos of a angle of a vector and a x axis, how to get that vector?


Like you said, there are two possible vectors. If we are talking about unit vectors, then the solutions are [cos a, sqrt(1-cos2 a)] and [cos a, -sqrt(1-cos2 a)]. If you don't care which one, then just pick one. If you do care which one, then you need another constraint in order to pick the right one.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this