1
$\begingroup$

I am trying to find the intersection points of two ellipses, given in a parametric form:

a = 1;
e = 0.7;
ϕ = π/6;
rotv = Normalize@{1, -1, 0};
x[θ_] := -a*e + a*Cos[θ];
y[θ_] := a Sqrt[1 - e^2]*Sin[θ];
rot = RotationMatrix[ϕ, rotv];
Solve[{x[θ1], y[θ1], 0} == 
  rot.{x[θ2], y[θ2], 0}, {θ1, θ2}]

But with this I get an empty output {}. But if I do:

el1[θ_] = {x[θ], y[θ], 0};
el2[θ_] = rot.{x[θ], y[θ], 0};
Solve[el2[t][[3]] == 0, t]
(*{{t -> -0.344559}, {t -> 1.58487}}*)

and

el1[-0.3445591705449694`]
el2[-0.3445591705449694`]

(*{0.241224, -0.241224, 0}*)
(*{0.241224, -0.241224, 0.}*)

so the solution exists but I wonder why, the above approach does not yield a result? (there is a similar question here but I do not really understand it much, I am basing my attempt on this)

$\endgroup$
8
  • $\begingroup$ Is there a reason you're solving a multivariate version in Solve? I don't think it's necessary. And by using the univariate form (what you more or less do in your second case) and by restricting the domain of the solutions (since it's parametrized and you only need one full orbit) you can get it to work. Alternatively you can remove the values for the coefficients and it will spit out the exact answer. $\endgroup$
    – b3m2a1
    Mar 8, 2017 at 20:44
  • $\begingroup$ Since you are only looking for a numerical solution, I would use NMinimize: NMinimize[ Norm[{x[\[Theta]1], y[\[Theta]1], 0} - rot.{x[\[Theta]2], y[\[Theta]2], 0}], {\[Theta]1, \[Theta]2}] $\endgroup$
    – bill s
    Mar 8, 2017 at 20:47
  • $\begingroup$ @MB1965 Not really, I am happy with the univariate solution. But regardless of this, I am interested, what I am doing wrong or why the multivariate approach seems to fail (specifically if I take into account that a similar example is used on Wolfram's site) $\endgroup$
    – atapaka
    Mar 8, 2017 at 20:52
  • 2
    $\begingroup$ Change e=0.7; to e=7/10; ? $\endgroup$
    – LouisB
    Mar 8, 2017 at 21:27
  • 1
    $\begingroup$ your first approach is three equations in two unknowns. There is a solution in this case but Solve will fail if it needs to resort to numerical methods. A better approach to this is to note the solution is where the rotation vector intersects the first ellipse, so Solve[{x[t], y[t]} == c rotv[[1 ;; 2]] , {c, t}] (Which will work with inexact parameters ) $\endgroup$
    – george2079
    Mar 8, 2017 at 22:01

1 Answer 1

3
$\begingroup$
a = 1;
e = 0.7;
b = x /. Quiet[Solve[Sqrt[1 - x^2/a^2] == e && x > 0, x][[1]]];
ro = RotationMatrix[Pi/6];
ell1[t_] := {a Cos[t], b Sin[t]}
ell2[t_] := ro.ell1[t]
int = ell1[t] /. Quiet[Solve[ell1[t] == ell2[s], {s, t}]]
ParametricPlot[{ell1[t], ell2[t]}, {t, 0, 2 Pi}, 
 Epilog -> {Red, PointSize[0.02], Point[int]}]

enter image description here

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.