1
$\begingroup$

I'm trying to solve this geometry problem using GeometricScene:

Find angle x:

enter image description here

Here's my (incomplete) code:

scene = GeometricScene[{{a, b, c, d, e, f}, {x}}, {GeometricAssertion[
     Triangle[{a, b, c}], "Counterclockwise"],
    GeometricAssertion[Triangle[{a, d, c}], "Counterclockwise"],
    GeometricAssertion[Line[{b, c}], "Horizontal"],
    Line[{b, e}],
    Line[{e, d}],
    PlanarAngle[{b, a, d}] == \[Alpha],
    PlanarAngle[{d, a, c}] == 2 \[Alpha],
    PlanarAngle[{e, b, c}] == \[Beta],
    PlanarAngle[{e, b, a}] == 2 \[Beta],
    CollinearPoints[{b, f, e}],
    CollinearPoints[{a, f, c}]
    (* PlanarAngle[{a,d,e}]== 2 \[Phi],*)
    }];
RandomInstance[scene]

As I've done in similar problems, I build up the constraints one by one, seeing the RandomInstance become more and more constrained. Once I get all the constraints imposed, I use:

Replace[x, %["Quantities"]]

to compute x.

All works fine until I try to impose

PlanarAngle[{a,d,e}]== 2 \[Phi]

which Mathematica will not then render. (I don't even try adding the remaining constraints.)

I believe I've defined sufficient elements and constraints up to the stated condition.

How can I add all the required constraints and thereby solve this geometry problem?

Incidentally:

$VersionNumber

13.1

$\endgroup$

2 Answers 2

3
$\begingroup$

Sometimes it fails to fulfil this assertion GeometricAssertion[{{b}, {c}}, {"OppositeSides", Line[{a, d}]}] (maybe a bug in RandomInstance) in which case the angle x is not unique.

scene = GeometricScene[{{a, b, c, d, e, 
     f}, {x, \[Alpha], \[Beta], \[Phi], theta}}, {GeometricAssertion[
     Triangle[{a, b, c}], "Counterclockwise"], 
    GeometricAssertion[Triangle[{a, d, c}], "Counterclockwise"], 
    GeometricAssertion[Line[{b, c}], "Horizontal"], Line[{b, e}], 
    Line[{e, d}], PlanarAngle[{b, a, d}] == \[Alpha], 
    PlanarAngle[{d, a, c}] == 2 \[Alpha], 
    PlanarAngle[{e, b, c}] == \[Beta], 
    PlanarAngle[{e, b, a}] == 2 \[Beta], CollinearPoints[{b, f, e}], 
    CollinearPoints[{a, f, c}],
    PlanarAngle[{a, d, e}] == 2 \[Phi], 
    PlanarAngle[{e, d, c}] == \[Phi], PlanarAngle[{d, c, b}] == theta,
     PlanarAngle[{a, f, e}] == 126 Degree, 
    PlanarAngle[{b, e, d}] == x, 
    PlanarAngle[{d, c, a}] == 180 Degree - 2 theta, 
    GeometricAssertion[{Line[{b, e}], Line[{a, c}]}, {"Concurrent", 
      f}], GeometricAssertion[{{b}, {c}}, {"OppositeSides", 
      Line[{a, d}]}]}];
RandomInstance[scene]
Replace[x, %["Quantities"]]/Pi*180

enter image description here

42.
$\endgroup$
2
  • $\begingroup$ Perfect. My silly mistake not to include the variables in the preface. Thanks. ($\checkmark$). $\endgroup$ Commented May 24 at 20:44
  • $\begingroup$ @DavidG.Stork It is not necessary, it works well for me even with {x}, if it is the only parameter of interest. $\endgroup$ Commented May 24 at 20:46
1
$\begingroup$

Addition of symbolic quantities helps. The following works in 14.0 on Windows.

scene = GeometricScene[{{a, b, c, d, e, 
 f}, {x, \[Alpha], \[Beta], \[Phi]}}, {GeometricAssertion[
 Triangle[{a, b, c}], "Counterclockwise"], 
GeometricAssertion[Triangle[{a, d, c}], "Counterclockwise"], 
GeometricAssertion[Line[{b, c}], "Horizontal"], Line[{b, e}], 
Line[{e, d}], PlanarAngle[{b, a, d}] == \[Alpha], 
PlanarAngle[{d, a, c}] == 2  \[Alpha], 
PlanarAngle[{a, d, e}] == 2  \[Phi], 
PlanarAngle[{e, b, c}] == \[Beta], 
PlanarAngle[{e, b, a}] == 2  \[Beta], CollinearPoints[{b, f, e}], 
CollinearPoints[{a, f, c}]
RandomInstance[scene]

Don't know how to present a picture.

$\endgroup$
1
  • $\begingroup$ Your code works and gives a figure, once I fixed your syntax errors. ... CollinearPoints[{a, f, c}]}]; Thanks! ($+1$) $\endgroup$ Commented May 24 at 20:42

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.