Message-ID: <32FA01D0.50EA@dtechs.com> Date: Thu, 06 Feb 1997 10:07:45 -0600 From: Mark Teel MIME-Version: 1.0 To: djgpp AT delorie DOT com Subject: Re: fwd: Re: ellipses at an angle Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit >If I say the area of a square is 1, is that the definition of the area of a >square? Or just the >definition of 1 of infinitely many different squares? He defined 1 >ellipse, not all ellipses (or >is it ellipsi?). And actually, even replacing it with a constant is not >exact since there are >no exact measures in our world... but don't get me started. Our friend Mr. Chambers stated (and I paraphrase): "an ellipse can be defined as the sum of the distances from any point on the ellipse to the two foci is equal to 1". Is this correct? >I'll try not to... I give below an answer to the question asked, but >first I'd like to correct your comment. >I believe what you are saying is that x^2/a^2 + y^2/b^2 = 1 is not >general, and that the 1 should be replaced by a constant, say n. Then >we would have x^2/a^2 + y^2/b^2 = n, which amounts to x^2/na^2 + >y^2/nb^2 = 1, and by replacing a with a.sqrt(n) and b with b.sqrt(n) >we get the equation above. x^2/a^2 + y^2/b^2 = 1 is as general as this >can get. It is also completely irrelevant for "ellipses at an angle" >as the subject says. This is not what I'm saying at all, and if you had followed the thread from the beginning, you would not have made such an assumption about what I was saying. But to shoot you down anyway, "x^2/a^2 + y^2/b^2 = 1 is as general as this can get" is FALSE. This only describes ellipses centered at the origin. >IMHO, the simplest way to draw an ellipse at an angle is to use the >polar representation, for which the origin is one of the foci, r is >the radius and T is the angle away from the other focus. Then >r=k/(1-e.cos(T)) >where e is the eccentricity and k is the semi-latus rectum. >Given the coordinates of the two foci and the eccentricity, then, we >can draw the ellipse using polars. k can be calculated as >k = (2.(1-e^2).d)/e >We then cycle T (theta) from 0 to 2.pi, and add the (constant) >rotation angle before taking its cosine each time. This could be >optimised in many ways. You may be right, I don't program shapes or mathematical graphs very often. I just wanted to be clear as to the general definition of an ellipse. The parametric treatment is perfectly acceptable to me. I am amazed (and sometimes disturbed) at how righteous some software folks become when rigorous definition is presented. I am a mathematician who makes his living designing software - I find both to be interesting (and sometimes intersecting).