How can I find the intersections between an arbitrary sine wave and circle?

691 Views Asked by At

I'm trying to write a program which finds the intersections between an arbitrary sine wave and an arbitrary sized and placed circle, in Cartesian coordinates, but I'm stuck with the math.

Here's a graphical example of the kind of intersections that I need to find: Example

I tried to mix both sine: $$y(x)=A\sin\left(\frac{2\pi}{T}x+\phi\right)$$ and circle equations: $$(x-\alpha)^2 + (y-\beta)^2 = r^2$$

But I don't get the right values. Besides, I can only define two points using the equalization and substitution methods, and if you look at the example, there are lots of intersections on the same circle.

What's the correct equation that I should use? And how get the different points defined?

$\mathbf{EDIT:}$

I already used this method trying to find intersections, and then I get and solve a quadratic equation, but this doesn't work: $$x^2-2\alpha x+\alpha^2+y^2-2\beta y+\beta^2 = r^2$$ $$x^2+\left(A\sin\left(\frac{2\pi}{T}x+\phi\right)\right)^2-2\alpha x-2\beta \left(A\sin\left(\frac{2\pi}{T}x+\phi\right)\right)+\alpha^2+\beta^2-r^2 = 0$$