I would like to be able to construct a sinusoidal function of limited domain given a set of real roots, assuming that the function is graphically centered on $y=0$.
I expect that this would graphically produce a sine wave with an irregular period because the given set of roots is allowed to vary freely among the real numbers.
How could this be done?
A truly sinusoidal function will have equally spaced roots. As long as the roots are rational multiples of each other, you can find the GCD of the roots and make this the half period of your function. That may result in a much higher frequency than you want. If the roots are not rationally related, you cannot find a GCD. Then the best you can do is to find an equation like $y=\sin (f(x))$ where $f(x)$ is slowly varying and takes values that are odd multiples of $\pi$ at the roots.