-2

The elliptic trajectory equation and hyperbola trajectory equation are generated according to the code, but the final form is not the standard form. How to generate the standard equation form?

The standard forms of elliptic equation and hyperbola equation are:

x^2/a^2 + y^2/b^2 == 1

x^2/a^2 - y^2/b^2 == 1

the first one Elliptical trajectory equation:

Clear["Global`*"]
expr = EuclideanDistance[{0, 4}, {x, y}] + 
   EuclideanDistance[{0, -4}, {x, y}] == 10
eq1 = Refine[Simplify[expr], 
   Assumptions -> {x \[Element] Reals, y \[Element] Reals}] // 
  FullSimplify
eq2 = SubtractSides[eq1, FirstCase[List @@ First@eq1, Sqrt[__]]]
eq3 = ApplySides[#^2 &, eq2] // Expand
eq4 = Apply[Subtract, eq3] == 0
eq5 = SubtractSides[eq4, FirstCase[List @@ First@eq4, k_*Sqrt[__]]]
eq6 = ApplySides[#^2 &, eq5] // Simplify

the result is:

25 x^2 + 9 y^2 == 225

The standard equation form is:

x^2/5+y^2/25==1

the second Hyperbola trajectory equation:

Clear["Global`*"]
expr = EuclideanDistance[{0, 2}, {3, 2}] - 
   EuclideanDistance[{0, -2}, {3, 2}] == 
  EuclideanDistance[{0, -2}, {x, y}] - 
   EuclideanDistance[{0, 2}, {x, y}] 
eq1 = Refine[Simplify[expr], 
  Assumptions -> {x \[Element] Reals, y \[Element] Reals}]
eq2 = ApplySides[#^2 &, eq1] // Simplify
eq3 = Fold[SubtractSides, eq2, Cases[List @@ First@eq2, Sqrt[__]]]
eq4 = ApplySides[#^2 &, eq3] // Simplify

the result is :

3 + x^2 == 3 y^2

The standard equation form is:

y^2-x^2/3==1

The results obtained are not in the form of standard equations. How can we obtain the standard equation?

csn899
  • 3,953
  • 6
  • 13
  • 1
  • Convert an expression from one form to another, 4. An easier way to find the properties of an ellipse from its equation?
  • – Domen Apr 19 '23 at 19:14
  • Please answer the questions in comment to clarify your problem. One more question: do you want -(x^2/3) + y^2 == 1 or -(x^2/(Sqrt[3])^2) + y^2/(1)^2 == 1 as the output? – xzczd Apr 20 '23 at 04:43
  • want to get x^2/5+y^2/25==1 and y^2-x^2/3==1 – csn899 Apr 20 '23 at 07:34
  • 1
    What you have posted is not really a complete standard form because it is missing an offset, and I have a strong feeling that when we answer this question, you will open a new one with "How to convert to standard form $(x-x_0)^2/a^2+(y-y_0)^2/b^2=1$?" Also, please address my questions above :) – Domen Apr 20 '23 at 08:07
  • ```Clear["Global`*"] exp = EuclideanDistance[{0, 2}, {x, y}] + EuclideanDistance[{0, -2}, {x, y}] == 10 expr = Refine[exp, Assumptions -> {x [Element] Reals, y [Element] Reals}] eqn = Apply[Subtract, expr] == 0 eq1 = SubtractSides[eqn, FirstCase[List @@ First@eqn, k_.Sqrt[__]]] eq2 = ApplySides[#^2 &, eq1] // Expand eq3 = Apply[Subtract, eq2] == 0 eq4 = SubtractSides[eq3, FirstCase[List @@ First@eq3, k_.Sqrt[__]]] eq5 = ApplySides[#^2 &, eq4] // Simplify
    
    
    – csn899 Apr 20 '23 at 14:59
  • add following code the result is wrong! – csn899 Apr 20 '23 at 15:00
  • sol = SolveAlways[First[eq5] == First[otherform], {x, y}] otherform /. First[sol]``` – csn899 Apr 20 '23 at 15:00
  • @Domen,The above method did not solve the problem – csn899 Apr 20 '23 at 15:14