|
|
In article <1235297.1162325667272.JavaMail.jakarta@xxxxxxxxxxxxxxxxxxxxxx>,
Magnus <maol9883@xxxxxxxxxxxxx> wrote:
>I have a number of questions. I want to find the closest distance and point on
>the curve to the point (x0, y0)
>1. Does a second order polynomial that always passes through the origin have
>its' constant c = 0 ?
The graph of a polynomial y = a_n*x^n + a_{n-1}x^{n-1} + ... +a_1*x + a_0
consists of all points (r,s) for which, if you plug in r for x, you
get s. So, if you hav ea polynomial (of ANY order), that goes through
the origin (0,0), that means that you should get 0 when you plug in
0. Plugging 0 gives you the constant term. So what should the constant
term be?
By the way, the possessive "its" does not have an apostrophe.
>2. The distance is given by r(x)=(x - x0)^2 + (ax^2+bx+c-y0)^2
No. This is the square of the distance.
Luckily, to get the smallest distance is the same as to get the
smallest square-of-the-distance, and it is easier to deal with the
above since there are no square roots.
>Differentiating it gives Dr(x) = 2(x - x0)+2(2ax + b)(ax^2+bx+c-y0)
>Finding its' roots means that I have to solve a cubic equation. I've
>solved it using Maxima and posted the results as PDFs below. Problem
>is that I can't test its validity for all points outside the
>curve.
Huh? What do you mean "test its validity for all points outside the
curve"?
You found solutions r1, r2, r3. Those are the values of x for which
the derivative is 0. So those are the potential extreme values for
r. The points in the curve you want are the points you get by plugging
in r1 for x (to get a point (r1, a*r1^2 + b*r1 + c)), and plugging in
r2, and plugging in r3. The closest point will be the one with the
smallest distance, which you can figure out by plugging in r1, r2, and
r3 into your function r(x).
What points are you trying to "validate"?
>It looks like it's working for some samples, but others cause
>'A' (see solution) to become a complex number. Why is that ? Is it
>suppose to be like that?
Some cubics have only one real root.
>http://home.student.uu.se/maol9883/files/equation.pdf
> home.student.uu.se/maol9883/files/solution.pdf">http://home.student.uu.se/maol9883/files/solution.pdf
These pages are useless (at least to me). They do not contain enough
information to figure out what you are doing, and "solution.pdf" is
incoherently formatted.
>I'm trying arbitrary functions y = ax^2 + bx + c with arbitary points
>to find the closest point between.
Given a point (x0,y0), some parabolas have a unique "closest point" to
it. Some have more than 1; for example, the closest points to (0,1) on
the parabola x=y^2 are (0,0), (1,1), and (-1,1), all of them distance
1. On the other hand, on the same parabola, there is a unique point
closest to (1,3).
--
======================================================================
"It's not denial. I'm just very selective about
what I accept as reality."
--- Calvin ("Calvin and Hobbes" by Bill Watterson)
======================================================================
Arturo Magidin
magidin-at-member-ams-org
|
|