One way we did it in Sphere Game engine was to:
1. Convert your ellipse to a low count polygon.
2. Use this algorithm on each pixel in your object: inpoly.c

So you probably would have a point (x,y) and test it against the 5 olympic rings to see if it is in or out.
The algorithm is brilliant, fast and explained in: visibone inpoly

But I think you probably wanted to have the formula equation, where you isolate y^^2 and substitute that in the other equation of the second ellipse, then solve the equation to get the boundaries. The problem with that is that you get non Hilbert spaces, that is, picture a U in cartoony baloon font. Drawing a vertical line, will give you multiple contact points where you are in and out the structure, this can not be represented by a single formula, you will need to either test against each primitive (rectangle, ellipe), and that is basically what you are doing. Now 2 ellipses is of course a special case where you get a () kind of figure (forgot the mathematical name for that) and that is Hilbert. But the olympic rings together are not.
In any case, you should be able to modify the inpoly algorithm to get point in ellipse, and do that for all 5 ellipses. Or, just define 8 or 16 points in your ellipse and use the inpoly algorithm.


In reply to pixel in ellipsis: by FreeBeerReekingMonk
in thread Graphics math. by BrowserUk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.