Constructing rotation matrix with respect to central point

39 Views Asked by At

I am trying to implement an algorithm which has three points $z_0, z_1, z_2$ and creates a rotation matrix with respect to $z_0$. According to the paper, "we may apply a Gram-Schmidt process to compute a 3x3 rotation matrix with rows:

$r_1 = (z_1-z_0) / \lVert z_1 - z_0 \rVert$

$r_2 = ((z_2-z_0) - ((z_2-z_0) \cdot r_1) / \lVert ((z_2-z_0) - ((z_2-z_0) \cdot r_1) \rVert$

$r_3 = r_1 \times r_2$

"

However, I am quite confused because these formulae don't look like the Gram-Schmidt process and also don't always produce an orthonormal or orthogonal matrix (required for a valid rotation matrix). In order to produce a valid rotation matrix $r$, the three points ($z_0, z_1, z_2$) have to be axis-aligned, but I am unsure what to do when they aren't, or how to align them without destroying the geometry. Is there anything I am missing/not understanding here?

1

There are 1 best solutions below

0
On BEST ANSWER

Is is actually a variant the Gram-Schmidt process.

The formulas give the orthonormal family $(r_1,r_2)$ generated the same plane as $(z_1-z_0,z_2-z_0)$. We have to assume that $z_0,z_1,z_2$ are not in a same affine line for $(z_1-z_0,z_2-z_0)$ to be free. Moreover the formula giving $r_2$ has to be is corrected into $$r_2 = \frac{(z_2-z_0) - ((z_2-z_0) \cdot r_1)r_1}{\lVert [(z_2-z_0) - ((z_2-z_0) \cdot r_1)r_1 \rVert}.$$

Actually, two non-colinear vectors $u$ and $v$ are sufficient to generate an arbitrary direct orthonormal basis, by computing $u$, $v-\frac{(u \cdot v)}{(u \cdot u)}u$ and their vector product and by dividing these three vectors by their norm.