Circle inside ellipse collision/intersection (preventing circle from leaving the ellipse)

I am working on a 2D RPG with a turned based battle system.

Characters move inside the confines of an ellipse movement area and when they leave the boundaries will be pushed back inside. (i.e they should be able to walk around the inner part of the ellipse). Previously we were using circles for the movement area and I wrote the code to do circle inside circle collision (not too difficult because the radius is always the same) but since we will change to using an ellipse, I am trying to update the code.

I have looked at a few solutions for actual ellipse collision/intersection and the math looks..daunting. My questions are:

1. Are there any clean solutions to doing circle inside ellipse collision/intersection?

2. Should I be approximating the ellipse collision in another way? Like using an n-sided polygon?

I am a bit lost on how to approach this and could really use some advice.

• @AlexandreVaillancourt That question is helpful, but I think it's not a duplicate: this question asks how to confine a circle in an ellipse. That one just detects whether it would be necessary.
– Anko
Commented Sep 26, 2015 at 13:11
• @Anko The question was edited since I flagged it. Not sure if removing the comment will remove the flag, though.. Commented Sep 26, 2015 at 13:15
• There is here a question about circle-ellipse collision. It could help you with part of your issue :) Commented Sep 26, 2015 at 13:26
• Yes it helps a little bit. But as one of the comments states "...but not for doing circle-in-ellipse testing (or circle-ellipse intersection testing), which is actually a substantially harder problem." So that is a small part of the problem. Commented Sep 26, 2015 at 13:53
• Naive approach: compute the smaller ellipse resulting from substracting the radius of the circle from the focal points of the main elipse. Then: is the center of the circle inside that smaller ellipse? (math.stackexchange.com/questions/76457/…)
Commented Sep 28, 2015 at 21:43