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

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:\sqrt{\left(}\frac{1}{3}\right),y:\sqrt{\left(}\frac{1}{3}\right),z:-\sqrt{\left(}\frac{1}{3}\right)\phantom{\rule{0ex}{0ex}}B:x:\sqrt{\left(}\frac{1}{3}\right),y:\sqrt{\left(}\frac{1}{3}\right),z:\sqrt{\left(}\frac{1}{3}\right)$
As I visualize it, these two vectors are separated by 90°, but the dot product of these vectors comes out to $\frac{1}{3}$
$\sqrt{\left(}\frac{1}{3}\right)\ast \sqrt{\left(}\frac{1}{3}\right)+\sqrt{\left(}\frac{1}{3}\right)\ast \sqrt{\left(}\frac{1}{3}\right)+\sqrt{\left(}\frac{1}{3}\right)\ast -\sqrt{\left(}\frac{1}{3}\right)\phantom{\rule{0ex}{0ex}}=\frac{1}{3}+\frac{1}{3}-\frac{1}{3}\phantom{\rule{0ex}{0ex}}=\frac{1}{3}\phantom{\rule{0ex}{0ex}}$
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?
You can still ask an expert for help

## Want to know more about Matrix transformations?

• Questions are typically answered in as fast as 30 minutes

Solve your problem for the price of one coffee

• Math expert for every subject
• Pay only if we can solve it

Harley Fitzpatrick
Your two vectors are parallel to the vectors $\left(1,1,1\right)$ and $\left(1,1,-1\right)$. 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 $\sqrt{2}$. So each of these vectors is the hypotenuse of a triangle with sides $\sqrt{2}$ and $1$. So the angle between each of these vectors and the $x,y$ plane is ${\mathrm{tan}}^{-1}\left(\frac{1}{\sqrt{2}}\right)\approx {35.26}^{o}$. And the angle between the two vectors is therefore $2×{35.26}^{o}={70.52}^{o}$.
And $\mathrm{cos}\left(2×{\mathrm{tan}}^{-1}\left(\frac{1}{\sqrt{2}}\right)\right)=\frac{1}{3}$, which confirms what the dot product calculation tells us. A rotation by ${90}^{o}$ about the $x$ axis $\left(x,y,z\right)↦\left(x,z,-y\right)$ will rotate vectors in the $y,z$ plane through ${90}^{o}$, but vectors like $\left(1,1,1\right)$ which are not in the $y,z$ plane will not be rotated by ${90}^{o}$
###### Not exactly what you’re looking for?
Jorge Lawson
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 ${\mathrm{cos}}^{-1}\left(\frac{1}{3}\right)\approx {70.53}^{\circ }$