Forgive me for such a basic question but I'm having issues and my Google-fu is failing me.

I have a line segment from P1 to P2

Assuming that the origin is P1, I can get the spherical coordinates (r, theta, phi) of line segment but I can't seem to figure out how to go from that to a rotation matrix. Any help, even in the form of a link to a explanation, would be appreciated

I have a line segment from P1 to P2

Assuming that the origin is P1, I can get the spherical coordinates (r, theta, phi) of line segment but I can't seem to figure out how to go from that to a rotation matrix. Any help, even in the form of a link to a explanation, would be appreciated