I have a set of five points in $3D$ space. Four of them (red, green, orange, and blue- see setup image) are connected to each other by arms of fixed length that can be twisted by some angle around their axis. The last point (in black) is completely independent of the four and no twisting of the arms can affect it. The four (connected) points form a dihedral angle $\Phi$ which, upon a change $\Delta\Phi$, moves the green-red arm around the axis of rotation and changes the red point’s position (a full 2π rotation would form a cone).
I have an equation $f(s)$, where $s$ is the magnitude of vector $\vec{s}$ (shown below), or the distance between points red and black. I have some notes that show that in order to find $\frac{df}{d\Phi}$ I have to use chain rule:
$$\frac{df}{d\Phi}=\frac{df}{ds}\frac{ds}{d\Phi}$$
My issue is with how they found the derivate of s with respect to $\Phi$, which they define as:
$$\frac{ds}{d\Phi}=(\vec{v}\times\vec{v'})\cdot\frac{\vec{s}}{|\vec{s}|}$$
I would like to understand how this derivative was obtained and how they figured out $s(\Phi)$.
I understand that the cross product above changes with a change in $\Phi$ and that by dotting the resulting vector with the unit vector in the direction to point black from point red gives the rate of change, but I don't quite understand why or how to obtain $s(\Phi)$.
Thanks for your time.

