Acos 90 degree matrix transformation. I'm writing a program that transforms a matrix of points by 9

Mauricio Hayden

Mauricio Hayden

Answered question

2022-05-24

Acos 90 degree matrix transformation.
I'm writing a program that transforms a matrix of points by 90°. In it, I have two vectors from which I am performing the rotation. Both vectors are normalized:
A : x : ( 1 3 ) , y : ( 1 3 ) , z : ( 1 3 ) B : x : ( 1 3 ) , y : ( 1 3 ) , z : ( 1 3 )
As I visualize it, these two vectors are separated by 90°, but the dot product of these vectors comes out to 1 3
( 1 3 ) ( 1 3 ) + ( 1 3 ) ( 1 3 ) + ( 1 3 ) ( 1 3 ) = 1 3 + 1 3 1 3 = 1 3
My code is then supposed to use arc-cos to come up with 90° from this number, but I believe arc-cos needs an input of 0 in order to produce a result of 90°. What am I missing here?

Answer & Explanation

Harley Fitzpatrick

Harley Fitzpatrick

Beginner2022-05-25Added 13 answers

Your two vectors are parallel to the vectors ( 1 , 1 , 1 ) and ( 1 , 1 , 1 ). You can think of each these vectors as being the diagonal of a unit cube - one unit cube sitting above the x , y plane and its mirror image below the x , y plane.
The projection of one of these vectors on the x , y plane has length 2 . So each of these vectors is the hypotenuse of a triangle with sides 2 and 1. So the angle between each of these vectors and the x , y plane is tan 1 ( 1 2 ) 35.26 o . And the angle between the two vectors is therefore 2 × 35.26 o = 70.52 o .
And cos ( 2 × tan 1 ( 1 2 ) ) = 1 3 , which confirms what the dot product calculation tells us. A rotation by 90 o about the x axis ( x , y , z ) ( x , z , y ) will rotate vectors in the y , z plane through 90 o , but vectors like ( 1 , 1 , 1 ) which are not in the y , z plane will not be rotated by 90 o
Jorge Lawson

Jorge Lawson

Beginner2022-05-26Added 4 answers

When you have a visualization of a 3D objects there always is some kind of projection to a 2D plane – the screen plane. You should not rely on projected lengths, angles, areas etc. when you don’t know the type of projection and understand its properties. They might be misleading.
But your calculations are correct: the vectors are not orthogonal! The angle is cos 1 ( 1 3 ) 70.53

Do you have a similar question?

Recalculate according to your conditions!

New Questions in Linear algebra

Ask your question.
Get an expert answer.

Let our experts help you. Answer in as fast as 15 minutes.

Didn't find what you were looking for?