Solving a cubic to find nearest point on a curve to a point

蹲街弑〆低调 提交于 2019-12-04 13:01:51

Real polynomials can have complex number roots and if the roots are not real, they occur in conjugate pairs.

This implies cubics always have at least one real root.

Now if you get a complex root using your method, you can try to get the conjugate, mutiply and divide the constant of the cubic, take reciprocal to get the real root.

So if you had to take the square root of a -ve number, then it is same as multiplying the square root of its modulus by the imaginary number 'i'.

So if you represent your root as (m,n) denoting the complex number m + in. Then the other root is m - in = (m, -n) and m and n are real numbers.

The cubic can then be written as P(x) = (x^2 - 2m + (m^2 + n^2))(x-r).

So if P(x) = x^3 - a_1 *x^2 + a_2*x - a_3, then we have that r = a_3/(m^2 + n^2) (a_3 is the product of the roots, which is r(m^2+n^2))

A simpler way to get r would be to use the formula r = a_1 - 2m (a_1 is the sum of the roots, which is r+2m).

Check out: http://en.wikipedia.org/wiki/Complex_number

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!