({{, (RefLink[RandomInstance, paclet:ref/RandomInstance])[expr] 
finds a random instance of an expression such as a geometric scene.}, {, (RefLink[RandomInstance, paclet:ref/RandomInstance])[expr,n]
finds n instances.}})

OpenersNotesSection(Spacer1)Details and Options

When expr is a (RefLink[GeometricScene, paclet:ref/GeometricScene]), (RefLink[RandomInstance, paclet:ref/RandomInstance]) gives a (RefLink[GeometricScene, paclet:ref/GeometricScene]) or a list of (RefLink[GeometricScene, paclet:ref/GeometricScene]) objects.

(RefLink[RandomInstance, paclet:ref/RandomInstance]) makes assumptions by default. For example, it assumes points appearing in a (RefLink[GeometricScene, paclet:ref/GeometricScene]) are in general position and that regions appearing in a (RefLink[GeometricScene, paclet:ref/GeometricScene]) are nondegenerate.

The following options can be given:

OpenersPrimaryExamplesSection(Spacer1)Examples  (4)

OpenersExampleSection0(Spacer1)Basic Examples  (1)

Represent a symbolic geometric scene containing a triangle with points a, b, c and a 30° angle:

GeometricScene[{a,b,c},{Triangle[{a,b,c}],PlanarAngle[{a,b,c}]==30°}]

(RefLink[RandomInstance, paclet:ref/RandomInstance]) finds a particular instance of the scene:

RandomInstance[%]

Rules giving coordinates for the points have been filled in:

%//InputForm

Find multiple instances of the scene:

RandomInstance[%1,5]

OpenersExampleSection1(Spacer1)Options  (1)

OpenersExampleSubsection0(Spacer1)RandomSeeding  (1)

By default, (RefLink[RandomInstance, paclet:ref/RandomInstance]) finds different solutions each time:

RandomInstance[GeometricScene[{a,b,c},{Triangle[{a,b,c}]}],4]

Use (RefLink[RandomSeeding, paclet:ref/RandomSeeding])->seed to use an explicit integer or string as a seed:

RandomInstance[GeometricScene[{a,b,c},{Triangle[{a,b,c}]}],RandomSeeding->1]

RandomInstance[GeometricScene[{a,b,c},{Triangle[{a,b,c}]}],RandomSeeding->1]

OpenersExampleSection2(Spacer1)Applications  (1)

Decompose a polygon into similar triangles:

RandomInstance[GeometricScene[{a,b,c,d,g,e,f},{
p0==Polygon[{e,g,f}],
p1==Style[Polygon[{a,b,c}],Red],
p2==Style[Polygon[{b,c,d}],Green],
p3==Style[Polygon[{d,c,g}],Blue],
p4==Style[Polygon[{g,c,a}],Magenta],
p5==Style[Polygon[{e,d,b}],Cyan],
p6==Style[Polygon[{g,a,f}],Yellow],
GeometricAssertion[{p0,p1,p2,p3,p4,p5,p6},"Similar"]
}
],RandomSeeding->3]

OpenersExampleSection3(Spacer1)Properties & Relations  (1)

Use (RefLink[RandomInstance, paclet:ref/RandomInstance]) to find random polygons:

RandomInstance[GeometricScene[{a,b,c,d,e},{Polygon[{a,b,c,d,e}]}],5]

This can also be done with (RefLink[RandomPolygon, paclet:ref/RandomPolygon]):

Graphics/@RandomPolygon[5,5]

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(RefLink[FindInstance, paclet:ref/FindInstance])  ▪  (RefLink[GeometricScene, paclet:ref/GeometricScene])  ▪  (RefLink[FindGeometricConjectures, paclet:ref/FindGeometricConjectures])  ▪  (RefLink[RandomVariate, paclet:ref/RandomVariate])  ▪  (RefLink[RandomPoint, paclet:ref/RandomPoint])}})}})

({{DocumentationFooterIconsRelatedTutorial.png, ({{Tutorials}, {▪(RefLinkPlain[Synthetic Geometry, paclet:tutorial/SyntheticGeometry])}})}})

({{DocumentationFooterIconsRelatedGuide.png, ({{Related Guides}, {▪(RefLinkPlain[Plane Geometry, paclet:guide/PlaneGeometry])}, {▪(RefLinkPlain[Synthetic Geometry, paclet:guide/SyntheticGeometry])}, {▪(RefLinkPlain[Geometric Computation, paclet:guide/GeometricComputation])}, {▪(RefLinkPlain[Solvers over Regions, paclet:guide/GeometricSolvers])}})}})