a rotation matrix from one direction to another

Started by raft, January 02, 2010, 04:31:47 PM

Previous topic - Next topic

raft

hi,

how can i create a rotation matrix such that, when applied, it rotates a direction vector to another ?

formally:
SimpleVector from;
Simplevector to;

from.matMul(m);
from.equals(to); // -> should be true ignoring rounding errors

EgonOlsen

Getting the rotation matrix of the first vector, inverting it and multiplying the result with the rotation matrix of the second vector might work...

raft