Group Abstract Group Abstract

Message Boards Message Boards

0
|
2.2K Views
|
8 Replies
|
3 Total Likes
View groups...
Share
Share this post:

Solve geometric quantities using GeometricScene

Posted 11 months ago

I constructed the following GeometricScene with parameters {s,r}. The scene consists of a circle of radius r, and an equilateral triangle {a,b,c} inscribed in the circle. s being the length of one side of the triangle. I want to calculate the value of s, dependent on the value of r.

scene=GeometricScene[{{a,b,c,o},{s,r}},{CircleThrough[{a,b,c},o,r],GeometricAssertion[Triangle[{a,b,c}],"Equilateral"],s==TriangleMeasurement[{a,b,c},"Perimeter"]}];
RandomInstance[scene]
s/.%["Quantities"]

It returns 4.41219 as the value of s. I'm guessing behind the scenes, Mathematica chose a value for r and use that value for s. Is there any way to get an analytical solution of s dependent on r?

POSTED BY: Xiangyang Zhou
8 Replies
Posted 10 months ago

"Quantities" gave the values for the particular instance of the scene found by RandomInstance. You can use GeometricSolveValues on the abstract scene instead:

scene = GeometricScene[{{a, b, c, o}, {s, 
     r}}, {CircleThrough[{a, b, c}, o, r], 
    GeometricAssertion[Triangle[{a, b, c}], "Equilateral"], 
    s == TriangleMeasurement[{a, b, c}, "Perimeter"]}];

GeometricSolveValues[scene, s]

{ConditionalExpression[s, 
  Sqrt[(Indexed[a, {1}] - Indexed[b, {1}])^2 + (Indexed[a, {2}] - 
        Indexed[b, {2}])^2] + 
     Sqrt[(Indexed[a, {1}] - Indexed[c, {1}])^2 + (Indexed[a, {2}] - 
        Indexed[c, {2}])^2] + 
     Sqrt[(Indexed[b, {1}] - Indexed[c, {1}])^2 + (Indexed[b, {2}] - 
        Indexed[c, {2}])^2] == 
    s && (Indexed[a, {1}] - Indexed[b, {1}])^2 + (Indexed[a, {2}] - 
       Indexed[b, {2}])^2 == (Indexed[b, {1}] - 
       Indexed[c, {1}])^2 + (Indexed[b, {2}] - 
       Indexed[c, {2}])^2 == (Indexed[a, {1}] - 
       Indexed[c, {1}])^2 + (Indexed[a, {2}] - 
       Indexed[c, {2}])^2 && (Indexed[a, {1}] - 
       Indexed[o, {1}])^2 + (Indexed[a, {2}] - 
       Indexed[o, {2}])^2 == (Indexed[b, {1}] - 
       Indexed[o, {1}])^2 + (Indexed[b, {2}] - 
       Indexed[o, {2}])^2 == (Indexed[c, {1}] - 
       Indexed[o, {1}])^2 + (Indexed[c, {2}] - Indexed[o, {2}])^2 == 
    r^2 && r > 0]}

GeometricSolveValues output for abstract scene

POSTED BY: Ian Ford
Posted 10 months ago

Hi Ian,

Thanks for helping out here. If you Eliminate all the indexed variables from the returned equations as Gianluca suggested, you'll get this equation: 81 r^4 s^6 - 30 r^2 s^8 + s^10 == 0, and solve for s will result in the following solutions:

{{s->0},{s->0},{s->0},{s->0},{s->0},{s->0},{s->-3 SqrtBox["3"] r},{s->-SqrtBox["3"] r},{s->SqrtBox["3"] r},{s->3 SqrtBox["3"] r}} 

It returns two non-zero positive solutions: 3 Sqrt[3] r and Sqrt[3] r. What puzzles me is the solution of Sqrt[3] r. It is a solution to the equation obtained from Eliminate, but it isn't a solution to the geometric problem. I expect 3 Sqrt[3] r to be the only non-negative solution. What're your thoughts?

POSTED BY: Xiangyang Zhou

I am no expert, but maybe the culprit is the first equation, that contains three square roots. Perhaps Eliminate transforms it into a polynomial equation, and in doing so it introduces spurious solutions.

POSTED BY: Gianluca Gorni

You can check that s == r*Sqrt[3] is not a solution this way:

sols = Reduce[Most[eqs] && s == r*Sqrt[3]] // Reduce
Implies[sols, r == 0] // Reduce
POSTED BY: Gianluca Gorni
Posted 10 months ago

r*Sqrt[3] is a solution of the system returned by Eliminate[Most[eqs], Cases[eqs, _Indexed, All]]. This is what puzzles me, it is a solution to the eqs from the scene, yet it is NOT a solution to the scene itself. The expected solution is 3 Sqrt[3] r.

POSTED BY: Xiangyang Zhou

Eliminate gives necessary conditions, not always sufficient. Try this:

GeometricScene[{{a, b, c, o}, {s, r}}, {CircleThrough[{a, b, c}, o, r],
    GeometricAssertion[Triangle[{a, b, c}], "Equilateral"], 
   s == TriangleMeasurement[{a, b, c}, "Perimeter"], 
   s != 3 Sqrt[3] r}]["Conclusions"]
POSTED BY: Gianluca Gorni
Posted 11 months ago

This certainly got me to the next step. However, it gives the following solutions,

{{s->0},{s->0},{s->0},{s->0},{s->0},{s->0},{s->-3 SqrtBox["3"] r},{s->-SqrtBox["3"] r},{s->SqrtBox["3"] r},{s->3 SqrtBox["3"] r}} 

What puzzels me is that Sqrt[3]*r is not a solution. If I add that to the scene, Mathematica will have a hard time to find an instance.

scene=GeometricScene[{{a,b,c,o},{s,r}},{CircleThrough[{a,b,c},o,r],GeometricAssertion[Triangle[{a,b,c}],"Equilateral"],s==TriangleMeasurement[{a,b,c},"Perimeter"],s==Sqrt[3] r}];
RandomInstance[scene]

Was it a bug or something's wrong in my scene? Thank you!

POSTED BY: Xiangyang Zhou

This may be a start:

eqs = scene["AlgebraicFormulation"]
Eliminate[Most[eqs], Cases[eqs, _Indexed, All]]
Solve[%, r]
POSTED BY: Gianluca Gorni
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard