# Locating the intersections of two circles in a GeometricScene where the points are symbolic

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

segmentMidPoint=.;segmentMidPoint=Function[{a,b},
Block[{steps,l,c1,c2,i1},
steps={};
l=Line@{a,b};
c1=Circle[a,EuclideanDistance[a,b]];
AppendTo[steps,GeometricScene[{a,b},{l,c1}]];

c2=Circle[b,EuclideanDistance[a,b]];
AppendTo[steps,GeometricScene[{a,b},{l,c1,c2}]];

i1=First@RegionIntersection[c1,c2];
Print@RegionIntersection[c1,c2]
]];
Print@segmentMidPoint[a, b];


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

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]]
]


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

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}}}


### Update

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]


FindGeometricConjectures[example]["Conclusions"]

{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 °}

• 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] }]; Commented Dec 10, 2020 at 4:25
• @PedroSobota. I have updated my answer to address the issue you raise in your comment. Commented Dec 10, 2020 at 11:18