# figuring out the x,y, and z rotation of a right triangle?

How would I go about it?

-
Your question is too vague... – Aryabhata Dec 6 '10 at 20:47
It is not clear what the question is, nor what data is available for the solution. Do you want to bring a right triangle into some standard position? Or find what the angles at the vertices are? Or what? – Ross Millikan Dec 6 '10 at 20:50
How can I make it less vague? – CyanPrime Dec 6 '10 at 20:50
I have a triangle made of 3 vertices. I need to know what the angle of the triangle is. – CyanPrime Dec 6 '10 at 20:52
Triangles generally have three vertices, and three angles. – Robin Chapman Dec 6 '10 at 21:19

So you have the co-ordinates $P_i = (x_i, y_i, z_i), \ \ i=1,2,3$ of the vertices and you want to find the angles of the triangle formed by $P_1, P_2, P_3$?

Let the angle at $P_1$ be $\theta_1$.

If

$\displaystyle \vec{a} = (x_3 -x_1, y_3 - y_1, z_3 - z_1)$
$\displaystyle \vec{b} = (x_2 - x_1, y_2 - y_1, z_2 -z_1)$

The we have that

$\displaystyle |\vec{a}| |\vec{b} | \cos \theta_1 = \vec{a} \cdot \vec{b}$

Where $|\vec{v}|$ is the length of $\vec{v}$ and $\cdot$ is the dot product.

Similarly, you can find the other angles.