The equation for n is y = (n-1)/n * x + 1-nWe want the (x,y) point where these two lines intersect. Since the y's are equal, we have
The equation for n+dn is y = (n+dn-1)/(n+dn) * x + 1-n-dn
(n-1)/n * x + 1-n = (n+dn-1)/(n+dn) * x + 1-n-dnMultiply both sides by n(n+dn):
(n-1)(n+dn)x + (1-n)n(n+dn) = n(n+dn-1)x + (1-n-dn)n(n+dn)After doing a bunch of obvious cancelling, we get:
x = n^2 + n*dnAs dn approaches 0, x = n^2. Plugging back into the original equation,
y = (n-1)/n * n^2 + 1-n = n(n-1) - (n-1) = (n-1)^2.Or:
y = (sqrt(x) - 1) ^ 2One more way to look at it is
sqrt(x) + sqrt(y) = 1
Instead, I chose to hold (x,y) fixed, and solve for all n that passed through (x,y).
This results in a quadratic equation in n (as at most two lines pass through any given point, which is easy to show--pick any two lines which intersect at some point, and imagine sweeping one of them through other positions--they must always intersect at different spots on the line).
Then, by handwaving (or guessing), assume that the case where only one line passes through the point, that must be on the edge of the curve. This is the point at which the determinant (discrimnant?) of the quadratic equation is 0, so at this point n drops out of the question entirely:
B^2 - 4AC = 0which is simply (note that the above form doesn't look like x and y are symmetric)
A = 1
B = (y-x-1)
C = x
x^2 + y^2 - 2xy - 2x - 2y + 1which can be factored as
(x-y)^2 = 2(x+y) - 1If a = x-y, b = x+y (which is a linear transform of the space, specifically a 45-degree rotation and a little bit of scaling), this is
a^2 = 2b -1or
b = 0.5 a^2 + 0.5which in the reference frame of a,b is just a parabola in 'normal' form, squished down by 0.5 and translated up by 0.5.
Note that because I dropped n out early, this solution is valid for all n, If you want to draw it for n outside the specified range, you have to draw the entire line, not just the line from (n,0)..(0,1-n)--or at least enough of the line to extend into the first quadrant.
y = -(1-n)*x/n + (1-n)I said that you could generate the curve by sweeping a line from angle 0 to 90 like a radar screen, and the point that makes the curve, for any given angle, is the point that intersects the above line AND, over the entire set of n, has a maximum distance x^2+y^2 from 0,0. Don't ask me to prove this; it seems intuitive to me that a point on my 'sweeping line' with a smaller x^2+y^2 would be hidden by other lines and would not generate the curve.
To do this, I had to convert to radial coordinates:
x=r*cos(theta)Subbing these into the equation of the line, I solved for r and got:
y=r*sin(theta)
r = [1-n] / [sin(theta) + n^-1*cos(theta) - cos(theta)]Now, my sweeping line, at any given angle, is just
theta = CSo if I hold theta constant, I can take the derivative of r with respect to n only, set this equal to 0, and thereby get n = f(theta) where distance r from 0,0 is a maximum.
Ugly math ensued. n comes out to be:
n = 1 / [1 + sqrt(tan(theta))]Subbing this back into my equation for the generating line gives me a nasty f(r,theta) which, when rearranged and transformed into f(x,y), yields the answer.