How to find $P_1$ in $(x,y)$ form

112 Views Asked by At

From following diagram, $A_1$ is center of circle of radius $r$. All distances are in coordinate system $(x,y)$. Distance from $A_1P_2$ is known. Distance $A_1,A_2,A_3$ is also known from origin. I want to find point $P_1$.

Find P1 if P2 and A1 is known

I appreciate any help in this regard.

Thanks.

2

There are 2 best solutions below

2
On BEST ANSWER

The following are equal. They have the same direction and unit length: $$ \frac{P_1-A_1}{r}=\frac{P_2-A_1}{|P_2-A_1|} $$ Therefore, assuming we know the coordinates of $P_2$ and $A_1$, $$ P_1=A_1+r\frac{P_2-A_1}{|P_2-A_1|} $$

2
On

The OP clarified in chat that he knows coordinates of $P_2$ and simply wants to compute the coordinates of $P_1$, i.e., the intersection of the circle around $A_1$ and the line going through $A_1$ and $P_2$. I hope they will also clarify this in the question.

Suppose that $A_1$ has coordinates $(x_A,y_A)$ and $P_2$ has coordinates $(x_P,y_P)$. Then the line going through $A_1$ and $P_2$ is $$\frac{y-y_A}{x-x_A}=\frac{y_P-y_A}{x_P-x_A}$$ or $$(x_P-x_A)(y-y_A)=(x-x_A)(y_P-y_A).$$

You also want $$(x-x_A)^2+(y-y_A)^2=r^2.$$

Let us denote $a=x-x_A$, $b=y-y_A$. (Which is the same as translating the origin of the coordinate system to the point $A$.) Then you have two equations $$(x_P-x_A)a=(y_P-y_A)b\\ a^2+b^2=r^2.$$ From the first equation you get $b=\frac{x_P-x_A}{y_P-y_A}a$. (You should think about the special case $y_P=y_A$ separately; you cannot divide by zero.)

If you plug this into the second equation you get $$b^2\left(1+\frac{(x_P-x_A)^2}{(y_P-y_A)^2}\right)=r^2.$$ You can solve for $b$. If you know $b$, you can compute $a$. Once you have $a$ and $b$ you can compute $x$ and $y$ easily.

You will get two solutions, since the line and the circle intersect in two points.


Maybe if you have a look of some of the results in Google Search for intersection line circle "analytic geometry" (or some similar search query), you might find several useful links which might help you with solving similar problems.