Re: Re: Ellipse equation simplification on Mathematica:

```On 28 May 2007, at 14:00, Narasimham wrote:

> On May 19, 1:54 pm, Andrzej Kozlowski <a... at mimuw.edu.pl> wrote:
>> On 18 May 2007, at 19:06, Narasimham wrote:
>>
>>>  Reference is made to:
>>
>>> threa...
>>
>>>  Constant[c,d th,ph] ;
>>
>>>  (*  th, ph are spherical cords of tip of tube  *)  ;
>>
>>>  cp = Cos[ph] ; sp = Sin[ph] ; cth = Cos[th] ; sth = Sin[th] ;
>>
>>> (*  earlier typo corrected *)
>>
>>>  d1 = Sqrt[(x + d cp cth + c )^2 + ( y + d cp sth )^2 + (d sp)^2 ]
>>
>>>  d2 =Sqrt[(x - d cp cth - c )^2 + ( y - d cp sth )^2 + (d sp)^2 ]
>>
>>>  FullSimplify[ d1 + d2 + 2 d - 2 a == 0] ;
>>
>>>  When d = 0, algebraic/trigonometric simplification brings about
>>> common ellipse form:
>>
>>> (x/a)^2 + y^2/(a^2-c^2) = 1
>>
>>>  Request help for bringing to standard form involving constants a,c
>>> and the new tube length constant d.
>>
>>>  Regards,
>>>  Narasimham
>>
>> I don't think such a form exists. Consider the following.
>>
>> id1 = {d1^2 - ((x + d*cp*cth + c)^2 + (y + d*cp*sth)^2 + (d*sp)^2),
>>     d2^2 - ((x - d*cp*cth - c)^2 + (y - d*cp*sth)^2 + (d*sp)^2),
>>         sp^2 + cp^2 - 1, sth^2 + cth^2 - 1};
>>
>> id = Prepend[id1, d1 + d2 + 2 d - 2 a];
>>
>> Now consdier first the case of the ellipse:
>>
>> d = 0;
>>
>>   gr = GroebnerBasis[id, {x, y, a, c}, {cp, sp, cth, sth, d1, d2},
>>    MonomialOrder -> EliminationOrder]
>>   {-a^4 + c^2 a^2 + x^2 a^2 + y^2 a^2 - c^2 x^2}
>>
>> This tells us that
>>
>> First[%] == 0
>> -a^4 + c^2*a^2 + x^2*a^2 + y^2*a^2 - c^2*x^2 == 0
>>
>> is the equation of the ellipse, and this can be easily brought to
>> standard form by hand. But now consider your "general" case:
>>
>>   Clear[d]
>>   gr = GroebnerBasis[id, {x, y, a, c, d}, {cp, sp, cth, sth, d1, d2},
>>    MonomialOrder -> EliminationOrder]
>>   {}
>>
>> This means that elimination cannot be performed and no "standard
>> form"
>> of the kind you had in mind exists. Unless of course there is a bug
>> in GroebnerBasis (v. unlikely) or I have misunderstood what you had
>> in mind.
>>
>> Andrzej Kozlowski
>
> I checked for case of tube parallel to x- or y-axis produces ellipses
> and suspected validity even in 3-D general case.
>
> Narasimham
>

OK., now I see that I misundertood you and  you wrote that cd,th,
ph (and presumably a) are supposed to be constants, so you do not
wish to eliminate them. But now one can easily prove that what you
get is not, in general, an ellipse. In this situation Groebner basis
works and you can obtain a rather  horrible quartic equation of your
surface:

id1 = {d1^2 - ((x + d*cp*cth + c)^2 + (y + d*cp*sth)^2 + (d*sp)^2),
d2^2 - ((x - d*cp*cth - c)^2 + (y - d*cp*sth)^2 + (d*sp)^2),
sp^2 + cp^2 - 1, sth^2 + cth^2 - 1};

id = Prepend[id1, d1 + d2 + 2*d - 2*a];

v = GroebnerBasis[id, {x, y, a, c, cp, cth}, {sth, sp, d1, d2},
MonomialOrder -> EliminationOrder][[1]];

First[v] == 0

is the equation (I prefer not to include the output here).

Looking at v see that the non zero coefficients are only the free
coefficient, the coefficients of x^2, y^2, x^2 y^2, x^4 and y^4. So
only in some cases  you will get a quadratic (for example when the
quartic happens to be a perfect square as in the case d=0,  or when
the free coefficient vanishes, as in the trivial case a=d,  or when
the coefficients of 4-degree terms vanish). One can work out all the
cases when gets a quadratic but it is also easy to find those when
one does not. For example, taking both th and ph to be 60 degrees (so
that cth and cph are both 1/2) we get:

v /. {cp -> 1/2, cth -> 1/2, d -> 4, a -> 2, c -> 1}

y^4 - 48 x^2 y^2 + 120 y^2 + 3600

This is certianly is not the equation of an ellipse.

Andrzej Kozlowski

```

• Prev by Date: Re: Stopping Automatic Animation in v6
• Next by Date: Re: asymptotics
• Previous by thread: Re: Ellipse equation simplification on Mathematica:
• Next by thread: Re: Re: Ellipse equation simplification on Mathematica: