I'm trying to intersect two circles in a GeometricScene.

Print@segmentMidPoint[a, b];

Up to the second GeometricScene, the scene is interpreted correctly.

enter image description here

Then, the intersection seems not to be interpreted.

I was able to create the intersection with specified points:

Block[{a, b, l, c1, c2, ml},
 a = {1, 0};
 b = {4, 0};
 l = Line@{a, b};
 c1 = Circle[a, EuclideanDistance[a, b]];
 c2 = Circle[b, EuclideanDistance[a, b]];
 Graphics@Line@RegionIntersection[c1, c2][[1]]

enter image description here

But I wish to do it with symbolic points (a, b, etc.).


1 Answer 1


Your code uses GeometricScene in ways that I have never considered and which I find confusing, so I'm not sure I understand your question, but why not something like this?

scene =
   GeometricScene[{{a, b, c}, {r}},
     {l == Line[{a, b}],
      c == Midpoint[{a, b}],
      r == EuclideanDistance[a, b],
      Circle[a, r],
      Circle[b, r]}];

examples = GeometricScene[RandomInstance[scene, 3, RandomSeeding -> 1]]


You can extract the values that were given to the points a, b, c with

DeleteCases[examples["Points"], Rule[C["GeometricPoint"][_] ,_], All]
{{a -> {0.432794, -2.27932}, b -> {1.0131, -0.0627347}, c -> {0.722947, -1.17103}}, 
 {a -> {0.284467, -5.31396}, b -> {-6.17663, 0.0374258}, c -> {-2.94608, -2.63827}}, 
 {a -> {3.65394, -2.12234}, b -> {-1.41588, -0.547701}, c -> {1.11903, -1.33502}}}


The following is added to address concerns raised by the OP in a comment to this answer.

How about this? It not only makes the construction, it makes the inference that m is the midpoint. Also, note how I tell GeometricScene to locate intersections.

scene =
  GeometricScene[{{a, b, p, q, m}, {r}},
   {l1 == Line[{a, b}],
    r == EuclideanDistance[a, b],
    c1 == Circle[a, r],
    c2 == Circle[b, r],
    p ∈ c1, p ∈ c2,
    q ∈ c1, q ∈ c2,
    GeometricAssertion[{p, q}, "Distinct"],
    l2 == Line[{p, q}],
    GeometricAssertion[{l1, l2}, {"Concurrent", m}]}];

example = RandomInstance[scene, RandomSeeding -> 1]


{m == Inactive[Midpoint][{q, p}], 
 m == Inactive[Midpoint][{a, b}], 
 GeometricAssertion[{Line[{a, m, b}], Line[{q, m, p}]}, "Perpendicular"], 
 Inactive[PlanarAngle][{a, m, p}] == 
   Inactive[PlanarAngle][{a, m, q}] == 
   Inactive[PlanarAngle][{b, m, p}] == 
   Inactive[PlanarAngle][{b, m, q}] == 90 °}
  • $\begingroup$ I don't know if there is something I have not gotten in your code, but my code is about demonstrating the midpoint construction, so I mustn't use the Midpoint function. I haven't been able to use the RegionIntersection inside of a GeometricScene by extending your code: RandomInstance@GeometricScene[{{a, b, c}, {r}}, { l == Line[{a, b}], c == Midpoint[{a, b}], r == EuclideanDistance[a, b], c1 = Circle[a, r], c2 = Circle[b, r], RegionIntersection[c1, c2] }]; $\endgroup$ Commented Dec 10, 2020 at 4:25
  • 1
    $\begingroup$ @PedroSobota. I have updated my answer to address the issue you raise in your comment. $\endgroup$
    – m_goldberg
    Commented Dec 10, 2020 at 11:18

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.