Answer the question
In order to leave comments, you need to log in
How to find the angle to rotate a vector?
I have 2 green dots in 3d space and a blue vector.
I need to rotate the blue vector along the plane defined by the normal of the first point so that it faces the second point, but I can figure out how to find the correct angle.
Well, or maybe there is an alternative way to find a point on the face of the cube, which is the point of inflection of the "thread" fixed in the green points.
Answer the question
In order to leave comments, you need to log in
You can find the cosine and sine of this angle by using the vector and dot product between the vectors in the two directions.
It is enough just to have the coordinates of both vectors (blue and purple) in Euclidean space.
Do products, divide the length of a vector or a number by the lengths of the original vectors and get the sine and cosine. This is already enough for the rotation matrix. But if you need the angle itself, then feed these values to the atan function. I don't know C#, but there must definitely be a version that takes sine and cosine values.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question