Rotate sphere to match curved line direction

I would like to create an object resembling a sphere at the end of a curved and moving rod.
In my example, I can place the sphere at the top of the rod, and it’s position is correct as it follows the tip of the rod, but it doesn’t rotate in the same directions the rod does. Any thoughts on how to achieve this?

Example_2.toe (6.7 KB)

Thank you!

Perhaps the attached version is what you’re looking for. It’s a good habit to try to do as many transforms as possible via the translate/rotate/scale parameters of the Geo COMP, that means they will be done by the GPU - and therefore basically free - in contrast to transforms on a SOP level which are done by the CPU.

Example_rotation.toe (6.7 KB)

That is good to know. Thank you!

Although nettoyeur’s solution worked perfectly, I wanted to find a way to make the angle of the sphere point in the same direction as a line, without rotating it in the Geometry comp, since I needed to have the sphere’s new point coordinates outputed.

After some tinkering, I found how by using the Slope Chop and calculating the angle with the inverse tangent of the last point’s derivatives.

I am not sure if I am overdoing it, but here is my solution, if it can help anybody else :

Example_3.toe (5.5 KB)

Any comments on this solution are welcome!