Pointing an ellipsoid to direction XYZ, how to define quaternion

Dear all, I have created an ellipsoid with its shape (1,1,6) as shown. I would like to make its tip to point to the direction (x,y,z). I was wondering how to define quatw, i, j, k.

I try to figure out how quaternion work but still in confusion. I cannot find the expression of quaternion in LAMMPS manual also.

Thank you,

https://en.wikipedia.org/wiki/Quaternion

https://en.wikipedia.org/wiki/Quaternions_and_spatial_rotation

https://github.com/lammps/lammps/blob/aa0b6c47c20cca07a7b2c63479ed7dd998094d3b/src/math_extra.h
(lines 587-699)

1 Like