Function Repository Resource:

GeometricSceneConstructor

Source Notebook

Create an interface for constructing a GeometricScene

Contributed by: Wolfram|Alpha Math Team (Jeremy Stratton-Smith)

ResourceFunction["GeometricSceneConstructor"][]

creates an interactive tool for generating a GeometricScene.

Details

ResourceFunction["GeometricSceneConstructor"] creates an interactive interface that allows users to create primitives and relations among them and then produces the corresponding GeometricScene or RandomInstance expression without the user having to build the code from the ground up.
The interface is broken up into two components, "Figures" and "Relations":
Figuresarea for adding primitives such as Line,Circle,Triangle, etc.
Relationsarea for adding relationships among the defined primitives such as "Parallel", "Inside", etc.
Figures are determined by symbols entered under the "Specifications" column, which accepts symbols and numbers in some cases (radius and angle for example). Additional properties of a given figure can be chosen from the fields under the "Properties" column while the "Styles" column allows users to customize the appearance of particular figures in the output.
To add a relation, the user must first enter one or more figures and then select them from the dialog accessed via the select figures button. Once the desired figures are selected, clicking select relations opens another dialog which allows for the particular kinds of relations available for the selected figures to be chosen.
Clicking Print GeometricScene will print out the symbolic GeometricScene[] object corresponding to the description provided while clicking Visualize GeometricScene will print a cell with RandomInstance[GeometricScene[]] and evaluate it to show a visualization of the scene.
Note that some properties and relations are mutually exclusive (i.e. if one is selected, selecting another for the same figure/relation will replace that selection with a different option).

Examples

Basic Examples (2) 

Create an interface for constructing GeometricScene expressions:

In[1]:=
ResourceFunction["GeometricSceneConstructor"][]

Add some figures, specifying the points and constants as needed:

Click Visualize GeometricScene to create and evaluate code that generates an instance of the scene. Even without any relations, we are able to build interesting scenes:

In[2]:=
RandomInstance[
 GeometricScene[{{a, b, c}, {r}}, {GeometricAssertion[
    CircleThrough[{a, b}, c, r], "Clockwise"], CircleThrough[{b, c}, a, r], CircleThrough[{a, c}, b, r]}]]
Out[2]=

Construct famous scenes like Thales's theorem:

In[3]:=
ResourceFunction["GeometricSceneConstructor"][]
In[4]:=
RandomInstance[
 GeometricScene[{a, b, c, o}, {Triangle[{a, b, c}], CircleThrough[{a, b, c}, o], Line[{a, o, b}]}]]
Out[4]=

Scope (3) 

Use the "Properties" column to state properties of individual figures:

In[5]:=
ResourceFunction["GeometricSceneConstructor"][]
In[6]:=
RandomInstance[
 GeometricScene[{a, b, c}, {GeometricAssertion[Line[{a, b}], "Horizontal", "Rightward"], GeometricAssertion[Line[{b, c}], "Vertical", "Upward"], Triangle[{a, b, c}]}]]
Out[6]=

Construct scenes with constraints or conditions on the figures by introducing relations:

In[7]:=
ResourceFunction["GeometricSceneConstructor"][]
In[8]:=
RandomInstance[
 GeometricScene[{a, b, c, d}, {InfiniteLine[{a, b}], InfiniteLine[{c, d}], Line[{a, c}], Line[{b, d}], GeometricAssertion[{Line[{a, c}], Line[{b, d}]}, "MatchingParallel"]}]]
Out[8]=

Click on the "Styles" column header to modify the appearance of elements in your scene:

In[9]:=
ResourceFunction["GeometricSceneConstructor"][]
In[10]:=
RandomInstance[
 GeometricScene[{a, b, c, d}, {Style[Triangle[{a, b, c}], Directive[{RGBColor[
      0.1970397497520409, 0.20027466239414055`, 0.8226596475165942], Opacity[0.5`]}]], GeometricAssertion[
    Style[Polygon[{a, b, c, d}], Directive[{RGBColor[0.9031662470435645, 0., 0.04931715877012283],
        Opacity[0.5`]}]], "Equiangular"]}]]
Out[10]=

Properties and Relations (2) 

Construct a simple scene and visualize it:

In[11]:=
ResourceFunction["GeometricSceneConstructor"][]
In[12]:=
RandomInstance[
 GeometricScene[{{a, b, o}, {r}}, {InfiniteLine[{a, b}], Line[{o, a}],
    CircleThrough[{a}, o, r], GeometricAssertion[{InfiniteLine[{a, b}], CircleThrough[{a}, o, r]}, "Tangent"]}]]
Out[12]=

Then use FindGeometricConjectures to draw conclusions from the scene:

In[13]:=
FindGeometricConjectures[%, _PlanarAngle == _]
Out[13]=

Construct a geometric scene with a numerical value for an angle:

In[14]:=
ResourceFunction["GeometricSceneConstructor"][]
In[15]:=
RandomInstance[
 GeometricScene[{a, b, c, d}, {InfiniteLine[{a, b}], InfiniteLine[{c, d}], Line[{a, c}], Line[{b, d}], PlanarAngle[{a, b, d}] == \[Pi]/3, GeometricAssertion[{InfiniteLine[{a, b}], InfiniteLine[{c, d}]}, "MatchingParallel"], GeometricAssertion[{Line[{a, c}], Line[{b, d}]}, "Parallel"]}]]
Out[15]=

Use the resource function GeometricSolve to compute the numerical value of another angle from the scene and confirm that it is the same value as the opposite angle:

In[16]:=
ResourceFunction["GeometricSolve"][%, PlanarAngle[{a, c, d}]]
Out[16]=
In[17]:=
N[Pi/3]
Out[17]=

Publisher

Wolfram|Alpha Math Team

Version History

  • 2.0.0 – 23 March 2023
  • 1.0.1 – 19 April 2022
  • 1.0.0 – 12 April 2022

Related Resources

Author Notes

To view the full source code for GeometricSceneConstructor, evaluate the following:

In[1]:=
SystemOpen[
 FileNameJoin[{DirectoryName[FindFile["ResourceFunctionHelpers`"]], "GeometricSceneConstructor.wl"}]]

License Information