Calculating rotations from xyz points

Hello,

I am facing a problem in calculating the rotation values from the location points. I need to calculate the rotation values from the location values and apply to the joints can someone please help me with this.

Thank you very much for you time.

Geometry nodes has the Align Euler to Vector Node

https://docs.blender.org/manual/en/3.1/modeling/geometry_nodes/utilities/align_euler_to_vector.html

Probably, but I have no experience in scripting…