4
$\begingroup$
  1. You have a circle of radius r centered at the origin.

  2. You have a circle of radius 1 centered at (1,0).

  3. You draw a ray through the point (0,r) and the point where the circles intersect.

  4. Let R be the point where the ray intersects the x-axis.

  5. The question is, what happens to the point R as $r\to 0$.

I have:

Manipulate[
  Graphics[{
    Circle[{1, 0}, 1],
    Circle[{0, 0}, r],
    Red, PointSize[Medium],
    Point[{0, r}],
    Point[{r^2/2, Sqrt[1 - (r^2/2 - 1)^2]}],
    Point[{2 + Sqrt[4 - r^2], 0}],
    HalfLine[{{0, r}, {r^2/2, Sqrt[1 - (r^2/2 - 1)^2]}}]},
    Axes -> True,
    PlotRange -> {{-2, 5}, {-2, 2}}], 
  {{r, 1.4}, 0, 1.5}]

Which produces this image.

enter image description here

Now, I did a bunch of math, similar triangles, etc., to find that the coordinates of the point of intersection is $(r^2/2,\sqrt{1-(r^2/2-1)^2}$ and the point R, where the ray intersects the x-axis, is $2+\sqrt{4-r^2}$.

I'm just wondering how folks might do this same thing without making those math calculations.

$\endgroup$
1
  • $\begingroup$ Perhaps you could use the new geometric region functions? For instance, the intersection point between the two circles could be represented as RegionIntersection[Circle[{1, 0}, 1], Circle[{0, 0}, r], HalfPlane[{{0, 0}, {1, 0}}, {0, 1}]]. $\endgroup$
    – MarcoB
    Commented Jan 25, 2016 at 1:26

1 Answer 1

3
$\begingroup$

Here is an example using geometrical region functions:

Manipulate[

 pointoncircle = RegionIntersection[
    Circle[{0, 0}, r],
    Circle[{1, 0}, 1],
    HalfPlane[{{0, 0}, {1, 0}}, {1, 1}]
  ];
 ray = HalfLine[{{0, r}, pointoncircle[[1]]}];
 pointonaxis = RegionIntersection[ray, InfiniteLine[{{0, 0}, {1, 0}}]];

 Graphics[{
   Circle[{0, 0}, r], Circle[{1, 0}, 1],
   Red, PointSize[Large],
   Point[{0, r}], pointoncircle, ray, pointonaxis
  },
  Axes -> True, PlotRange -> {{-2, 5}, {-2, 2}}
 ],

 {{r, 1.4}, 0.001, 1.5}
]

Mathematica graphics


Of course an alternative approach would be to set up appropriate equations describing the points you need, then letting Mathematica do the solving:

pointoncircle = Point[{x, y}] /. First@
   NSolve[{x^2 + y^2 == r^2, (x - 1)^2 + y^2 == 1, y >= 0}, {x, y}];

ray = HalfLine[{{0, r}, pointoncircle[[1]]}];

pointonaxis = Point[{x, 0} /. First@
    Solve[InterpolatingPolynomial[{{0, r}, pointoncircle[[1]]}, x] == 0, x]];

These definitions can be plugged into the Manipulate shown above with identical results.

$\endgroup$
1
  • $\begingroup$ An extremely well written answer. Thanks so much. $\endgroup$
    – David
    Commented Jan 25, 2016 at 15:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.