0

When I'm solving system of equations of ellipse and circle I get the quartic equation. The solution of equation is four complex roots. The plot shows that there is a two intersection points and two roots of four has small imaginary part but not zero. There are always some error in result values (I think, it is because non ideal computer computations) and I can't find a good threshold to filter that correct results with small imaginary part from the true complex numbers with true imaginary part.

Is there exist a reliable method to filter real roots with noise from true complex roots?

Robotex
  • 189
  • If $|\Im(a)|<1/10|\Re(a)|$, drop $\Im(a)$. It always works. – markvs Jan 04 '22 at 11:19
  • Hmmm. Interesting, I will try it at evening – Robotex Jan 04 '22 at 12:30
  • Will it make any false positive or false negative results? – Robotex Jan 04 '22 at 12:33
  • Of course it wll both but not for real live problems. – markvs Jan 04 '22 at 14:22
  • I believe this idea gives wrong results in two cases: 1) $\Re(x)$ is exactly zero, then small imaginary parts formed due to calculation errors never will be dropped; 2) $\Im(x)$ is relatively small, when ellipse and circle are near to intersection, but do not intersect in this point. Example for first case: $a=3$, $b=2$, $c=0$, $d=3$, $e=1$ (cacluation error can give small imaginary part for root). Example for second case: $a=3$, $b=2$, $c=3$, $d=3$, $e=1.8$ (there is small imaginary part which is less than 1/10 of real). Here, ellipse is $x^2/a^2+y^2/b^2=1$, circle is $(x-c)^2+(y-d)^2=e^2$. – Ivan Kaznacheyeu Jan 04 '22 at 14:59
  • I believe the better way of filtering is by absolute value of imaginary part (compare with typical value of computational error for your procedure), not relative one. Because you can always move your ellipse and circle to make real part arbitrarily high, but it doesn't create intersection point. Other method is to check if the point without imaginary part lies on circle and ellipse with necessary accuracy. – Ivan Kaznacheyeu Jan 04 '22 at 15:03
  • So, should I just drop the imaginary part and check is the real part the solution? Also, I found that as far the real part from correct answer as bigger the imaginary part. Can I just sum both values? – Robotex Jan 04 '22 at 15:18
  • Try to find the centres for the conics first, then the radius $r$ and the semi-axes. To see whether the centre of circle bounded by the parallel (or offset) curves of the ellipse with width $\pm r$. – Ng Chung Tak Jan 05 '22 at 02:13
  • @NgChungTak Hmmmm. Do you mean that I just need to check distance to points from circle's center and it should be equal to circle radius? – Robotex Jan 05 '22 at 12:12
  • @Robotex To be more preicise, by rolling a circle on the ellipse, that is either tangent internally or externally, the centre of circle will trace two parallel curves. Say for a small circle, there're two intersections (note that tangential implying repeated roots) when the centre is within the two offset curves. For a larger circle, it will be complicated and the "inner" curve may enclose the whole ellipse and there may be four intersections altogether. – Ng Chung Tak Jan 05 '22 at 23:26
  • Please refer to more cases in the link here. and here. For ellipse parallel curves here. – Ng Chung Tak Jan 05 '22 at 23:36
  • You might refer to this journal article. – Ng Chung Tak Feb 24 '22 at 05:14

0 Answers0