Finding a point having the radius, chord length and another point

Me and a friend have been trying to find a way to get the position of a second point (B on the picture) having the first point (A), the length of the chord (d) and the radius (r).

It must be possible right? We know the solution will be two possible points but since it's a semicircle we also know the x coordinate of B will have to be lower than A and the y coordinate must be always greater than 0. Think you can help?

Here's a picture to illustrate the example:

-

I prefer a trigonometric approach.

Points $A$ and $B$ on an origin-centered circle of radius $r$ can be represented as

$$A := (r \cos\alpha, r \sin\alpha) \qquad B := (r\cos\beta, r\sin\beta)$$

for angles $\alpha$ and $\beta$ as shown in the image.

Now, simply note that $\beta = \alpha - \theta$, where (as shown below) $\theta = 2\;\mathrm{asin}\frac{d}{2r}$, to get the location of $B$.

The formula for $\theta$ follows from the Law of Cosines:

$$d^2 = r^2 + r^2 - 2 r^2 \cos\theta = 2 r^2 ( 1 - \cos\theta) = 4 r^2 \sin^2\frac{\theta}{2} = \left( 2 r \sin\frac{\theta}{2} \right)^2$$

Therefore, $d = \pm 2 r \sin\frac{\theta}{2}$, although we can take the "$\pm$" to be "$+$". This gives $\theta = 2 \;\mathrm{asin}\frac{d}{2r}$, as claimed.

-
That did the trick! Thank you! –  Atekon Jul 2 '12 at 9:03

Just to give you the formulas @avatar is talking about:

Any point $(x,y)$ on a circle of radius $r$ around the origin satisfies

$$x^2+y^2=r^2$$

And the distance $d$ of two points $(x_i,y_i)$, $i=1,2$ is given by

$$(x_1-x_2)^2+(y_1-y_2)^2=d^2$$

edit:a totally different and maybe more elegant way to do this is to express the angle between A and B as a fuction of r and d using trigononetric fuctions (sorry for being vague, boarding my flight now)

-
So we've been trying to solve this using different approaches and this looked the simplest: $\begin{cases}x^2_2 + y^2_2 =r^2\\ (x_1-x_2)^2 + (y_1-y_2)^2 = d^2\\\end{cases} \\ \begin{cases}--------\\ x_1^2 -2x_1x_2 + x_2^2 + y_1^2 -2y_1y_2 + y_2^2 = d^2\\\end{cases}$ since $x_1^2+y_1^2=r_2^2$ and $x_2^2+y_2^2=r_2^2$ $\begin{cases}------------\\ -2x_1x_2 -2y_1y_2 + 2r^2 = d^2\\\end{cases} \\ \begin{cases}x_2 = \sqrt{r^2 - y_2^2}\\ -2x_1\sqrt{r^2 - y_2^2} -2y_1y_2 + 2r^2 = d^2\\\end{cases}$ but when we kept doing it we've reached a fifth degree polynomial... –  Atekon Jun 29 '12 at 15:36
are we missing something? (sorry for the double post but i've reached the maximum amount of chars –  Atekon Jun 29 '12 at 15:37
note that in ur last equation everything but $y_2$ is given and can be considered to be a constant. then it is of degree 2 –  Simon Markett Jun 29 '12 at 16:11

There are two variables $(a,b)$ the coordinates of B. Since B lies on the circle,it satisfies the equation of the circle. Also,the distance of $B$ from $A$ is $d$.You can apply distance formula to get an equation from this condition.Now you have two variables and two equations from two conditions,you can solve it now yourself.

-