This forum discussion might help:
Specifically the next to last post has an example of how to use rotationMatrixFromPositionVelocity.
This forum discussion might help:
Specifically the next to last post has an example of how to use rotationMatrixFromPositionVelocity.