Pi for non mathematician

92 Views Asked by At

I've been long gone from math (shamefully) and have trouble using some quite familiar concepts...

Consider the following picture in which I render two circles with radius 32 (2) on a plane of 1024 by 1024 (1).

I chose a point at which I render the first circle [x,y] (3).

I choose to render another circle exactly 1 radius above the first circle.

How do I calculate 4? Which is the intersection of the two circles? (can be left or right side).

I understand I can calculate the circumference and divide it by six to get the distance from the center of the upper circle to the intersection. But I need coordinates.

Any guide will be greatly appreciated!

enter image description here

1

There are 1 best solutions below

0
On BEST ANSWER

Call the center of the first circle $(x_1, y_1)$. And call the radius $r$ (which is 32, but my answer will be more general). The center of the second circle is $(x_2, y_2)$. You want to know the location of the intersections between the two circles. Here goes:

  1. $y_2 = y_1 + r$, because you've put the second circle one radius higher. And $x_1 = x_2$, because the two centers are vertically aligned.

  2. The intersection point must be at height $y_3 = y_1 + \frac{r}{2}$, because it's halfway (in height) between $y_1$ and $y_2$.

  3. The intersection point $(x_3, y_3)$ must have distance $r$ to the two circle centers. Writing that for the first circle center, we have

$$ \sqrt{ (x_3 - x_1)^2 + (y_3 - y_1)^2 } = r = \sqrt{r^2}. $$

which comes, from a long chain of steps, from Pythagoras' Theorem.

If two numbers have the same square root, they're the same number, so $$ (x_3 - x_1)^2 + (y_3 - y_1)^2 = r^2 $$

Now by step 2, we know that $y_3 - y_1$ is $r/2$, So we can say $$ (a - x_1)^2 + (r/2)^2 = r^2\\ (a - x_1)^2 + r^2/4 = r^2 \\ (a - x_1)^2 = \frac{3}{4} r^2. $$ That means that $(a - x_1)$ must be either $\sqrt{\frac{3}{4}} r$ or its negative.

In your case, this means that the intersection point is $$ \sqrt{ \frac{3}{4} } 32 \approx 27.71 $$ to the left or right of your circle centers, and the $y$-coordinate is 16 units greater than the first circle center. So $$ (x_3, y_3) \approx (x_1 \pm 27.71, y_1 + 16). $$