in reply to Graphics math.

I don't know about simplifying the number of tests, but if you are just looking to minimize the number of tests run at execution time, Would a bounding box be a possibility?

sub clip { if ( within_bounding_box ) { return 1 if .... } return 0; }

--MidLifeXis

Replies are listed 'Best First'.
Re^2: Graphics math.
by BrowserUk (Patriarch) on Jun 03, 2015 at 18:14 UTC
    Would a bounding box be a possibility?

    It certainly cuts down on the runtime tests for those points outside the bounding box, but if you imagine that there is nothing of interest outside the bounding box; it becomes the edges of the image.

    Ie. The image is scaled so that the bounding box of the clipped region becomes coincident with the screen or viewport. Then you back to square (or rectangle :) one.

    I'm just wondering if there is any mathematical way to "combine" the formulae of two or more partially overlapping ellipses? Trouble is, I haven't a clue what to search for.


    With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority". I'm with torvalds on this
    In the absence of evidence, opinion is indistinguishable from prejudice. Agile (and TDD) debunked