# Distance between parametric function and a point

Given a parametric function $$\begin{align*} x &= x_o + v_x t + \frac{1}{2} a_x t^2\\ y &= y_o + v_y t + \frac{1}{2} a_y t^2\end{align*}$$

and point $P$ at $(c, d)$ , find all point(s) on the function that are distance $R$ from point $P$, assuming that $R > 0$ and none of the constants equal $0$.

This is part of a programming project (that I'm doing on my own, not for homework), so the answer needs to be obtainable using only expressions. Graphically solving the problem won't be possible.

Thanks in advance.

-

Welcome to math.SE. If this is a homework, then please add `(homework)` tag. – user2468 Mar 29 '12 at 19:24
Not homework. Personal project, for fun. – Jon W Mar 30 '12 at 18:52

## 1 Answer

I'm note sure if `(homework)`.

Hint:

I'm assuming that we're given $R, c, d, x_0, v_x, a_x, y_0, v_y, a_y.$

The squared distance between $P = (c,d)$ and $(x,y)$ is given by $$R^2 = (x - c)^2 + (y - d)^2 \tag{1}$$ Substitute the definition of $$x = x_o + v_x * t + \frac{1}{2} * a_x * t^2 \tag{2} \\ y = y_o + v_y * t + \frac{1}{2} * a_y * t^2$$ in $(1)$

You're left with a polynomial in $t.$ Solve for $t,$ this will give you different values of $t = \{t_1, \ldots, t_4\}.$ Substitute each $t_i$ in $(2)$ to get different $(x,y)$ points.

Update # 1:

I'm too lazy to LaTeX the following equation:

````        2          2   4                            3
(0.25 ay  + 0.25 ax ) t  + (1.0 vy ay + 1.0 vx ax) t

      2                                       2               2
 + (vx  + 1.0 xo ax - 1.0 ax c - 1.0 ay c + vy  + 1.0 yo ay) t

                                                    2       2       2
 + (-2. vy c + 2. yo vy + 2. xo vx - 2. vx c) t + xo  + 2. c  - 1. R

                  2
 - 2. xo c - 2. yo   = 0
````

Anyways, that's the degree $4$ polynomial in $t.$ To find a closed-form expressions for the roots $$\{t_1 = \cdots, t_2 = \cdots, t_3 = \cdots, t_4 = \cdots\},$$ you will need to do a lot of algebra on this polynomial. For example this.

-

The problem is that because this is for a program, each possible value of $t$ must be defined as a single expression ($t1 = ..., t2 = ...$) using $R,c,d,x_0,v_x,a_x,y_0,v_y,a_y$. The numerical values for these constants are unknown, since the values will vary when this is used in the program. The problem that I'm facing is that when I take the expanded polynomial and solve for $t$ using my graphing calculator, it is unable to find a solution. – Jon W Mar 30 '12 at 18:46
@JonW I added some more comments to my answer,. – user2468 Mar 30 '12 at 19:00
– Jon W Mar 30 '12 at 19:09
@JonW Indeed.  The big expression above gives you $A, B, C, D, E.$ You're on the right path. – user2468 Mar 30 '12 at 19:11
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 23, "mathjax_display_tex": 4, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "english_confidence": 0.8416869640350342, "perplexity_flag": "middle"}