Hello,
I am try to setup an asset that needs to identify regions for biome selection. I would like to do this using ellipses so I can make an island of sorts using procedural code. Basically I need a function that will determine if a 2D point is inside our outside the circumference of an ellipses given 2 sets of x/y coordinates. The first set would determine the dimensions of the ellipse. The second set would be used to determine if the point was either inside or outside the ellipse returning Boolean.
I am pretty new to using geometry in a video game setting and am researching the math. I figured there were tons of situations where the same formulas/algorithms would be useful, e.g. target ranges, etc. I am guessing if there is not already an established way to do this easily, there are supportive libraries I am just not familiar with that might help with some of the heavier math.
Here are some of the articles I’ve been going from to try to get a handle on what I need to do so far:
http://en.wikipedia.org/wiki/Ellipse#Circumference
http://en.wikipedia.org/wiki/Elliptic_integral#Complete_elliptic_integral_of_the_second_kind
http://en.wikipedia.org/wiki/Circumference
http://www.mathopenref.com/coordparamellipse.html
http://www.mathopenref.com/coordgeneralellipse.html
http://www.mathopenref.com/coordcirclealgorithm.html
And just because I thought these would be interesting to do the same with:
http://en.wikipedia.org/wiki/Hypotrochoid
http://en.wikipedia.org/wiki/Epitrochoid
It would seem to me, plotting points along the edge of an ellipse and filling the area of an ellipse are easier (or maybe just done more often) than determining the circumference of an ellipse. Am I mistaken?
Can anyone help with how I can determine inside vs the outside of an ellipse. And as a bonus maybe explain how I can even expand on that to include procedurally generated shapes like an epitrochoid? (That would make for much more realistic shorelines, ranges, etc…)
Thank you in advance,
Boysenberry Payne