Message Boards Message Boards

Unable to render an explicit GeometricScene containing a Circle

Posted 5 years ago

I am using Mathematica v12 on Windows 64 and I am unable to render a GeometricScene containing a Circle.

$Version
(* "12.0.0 for Microsoft Windows (64-bit) (April 6, 2019)" *)

I was trying to adapt the example of the explicit triangle, which executes correctly.

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

However, when I apply this to a Circle of radius 1 centered at the origin, it does not return a graphic image.

gs = GeometricScene[{{o -> {0, 0}}, {r -> 1}}, {Circle[o , r]}]
(* GeometricScene[{{o},{r}},{Circle[o,r],o\[Equal]{0,0},r\[Equal]1},{}\
] *)

I can return an image if I wrap $gs$ in RandomInstance.

RandomInstance@gs

Circle Scene

Is this behavior expected or did I make a mistake in my approach? The only example in the documentation that is not wrapped in RandomInstance is the explicit triangle, so it is probably rare that one would not use it.

POSTED BY: Tim Laska
3 Replies

GeometricScene often generates points and scalar parameters, which (along with the points and scalars provided by the user in the first argument) must be given values before the scene will format as a graphical image. Hence if you aren't getting a graphical formatting, you should wrap the GeometricScene with RandomInstance (even if the scene is fully determined) to fill in the missing values.

POSTED BY: Daniel McDonald

Curious, Disk returns an image too:

GeometricScene[{{o -> {0, 0}}, {r -> 1}}, {Disk[o, r]}]
POSTED BY: Gianluca Gorni

Thank you Gianluca! It is always good to know about the alternatives. It appears that there is some touchiness when using Circular objects within GeometricScene. If you want to use hypotheses like area and perimeter relations, you need to use Disk, but Disk does not like a GeometricAssertion like "Tangent". Here are a few tests where I noted 3 problems:

RandomInstance[
 GeometricScene[{{o1, o2}, {r1, r2}}, {c1 == Disk[o1, r1], 
   c2 == Disk[o2, r2], Area[c1] == 8 Area[c2]}], RandomSeeding -> 1]
RandomInstance[
 GeometricScene[{{o1, o2}, {r1, r2}}, {c1 == Disk[o1, r1], 
   c2 == Disk[o2, r2], Perimeter[c1] == 2 Perimeter[c2]}], 
 RandomSeeding -> 1]
RandomInstance[
 GeometricScene[{{o1, o2}, {r1, r2}}, {c1 == Disk[o1, r1], 
   c2 == Disk[o2, r2], GeometricAssertion[{c1, c2}, "Tangent"]}], 
 RandomSeeding -> 1]
RandomInstance[
 GeometricScene[{{o1, o2}, {r1, r2}}, {c1 == Circle[o1, r1], 
   c2 == Circle[o2, r2], Area[c1] == 32 Area[c2]}], RandomSeeding -> 1]
RandomInstance[
 GeometricScene[{{o1, o2}, {r1, r2}}, {c1 == Circle[o1, r1], 
   c2 == Circle[o2, r2], GeometricAssertion[{c1, c2}, "Tangent"]}], 
 RandomSeeding -> 1]

Conjecture Tests

Maybe I will need to use both Circles and Disks to achieve what I want.

Thanks again for your help.

POSTED BY: Tim Laska
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract