I have radius to draw circle using formulation below:

rhom = 0.262707;
circle = Table[{rhom*Cos[Theta*Degree], rhom*Sin[Theta*Degree]}, {Theta, 1, 360}] // N;

I also have 2 lists of data points:


How to find the intersection point as shown in the figure below?

enter image description here

a = Interpolation[A];
b = Interpolation[B];
ptA = {t, a[t]} /. FindRoot[a[t]^2 + t^2 - rhom^2, {t, -.2}];
ptB = {t, b[t]} /. FindRoot[b[t]^2 + t^2 - rhom^2, {t, 0}];
{ptA, ptB}

(* {{-0.261721, 0.0227437}, {0.0231856, -0.261682}} *)

Show[Plot[a[t], {t, -1, -0.1}], Plot[b[t], {t, -1, 1}], 
 Graphics[{Circle[{0, 0}, rhom], PointSize[0.02], Red, 
   Point[{ptA, ptB}]}], PlotRange -> All]

enter image description here


You can solve it in different ways. There is the more basic math way using those conventional FindRoot, NSolve etc. I show here a method using a comparatively newer function in the family named MeshRegion.

  1. Generate a MeshRegion from the points giving you circle, and the lines a and b as 2D geometric boundaries.
  2. Then we take respective intersection between those objects, giving us 2D points that we are seeking.

So code is:

circle = MeshRegion[circle, Line[Range[Length@circle]~Join~{1}]];
{a, b} = MeshRegion[#, Line[Range@Length@#]] & /@ {A, B};
{ptA, ptB} = MeshCoordinates@RegionIntersection[##] & @@@ {{circle , a}, {circle , b}}


You can see the found points graphically.

Show[circle , a, b, Graphics@{Orange, PointSize@.01, Point /@ ptA}, 
 Graphics@{Green, PointSize@.01, Point /@ ptB}, Axes -> True]

enter image description here

Also note that the more number of points you have to discretely represent your geometric objects, the more accurate this solution will be.

  • $\begingroup$ I try use it on Version 10.3 but it does not work as your illustration above. I have error on code {ptA,ptB}=MeshCoordinates@RegionIntersection[##] & @@@ {{circle , a}, {circle , b}}. Please give me advice, @PlatoManiac $\endgroup$ – SelfA Feb 19 '18 at 3:59
  • $\begingroup$ The function MeshRegion is available from version 11, it will not work in 10.3. The other answer will work on 10.3. $\endgroup$ – PlatoManiac Feb 19 '18 at 10:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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