A
A
Arthur Grand2021-02-26 12:24:19
Mathematics
Arthur Grand, 2021-02-26 12:24:19

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.

6038bc5c12b60222067201.jpeg

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

1 answer(s)
W
Wataru, 2021-02-26
@wataru

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 question

Ask a Question

731 491 924 answers to any question