I know I can obtain the Area
of a Region
, both numerically and symbolically, for example:
Area@Ellipsoid[{0,0},{a,b}]
(* a*b*Pi *)
How can I get the same for the RegionIntersection
of two regions?
Let's say I have two regions
ClearAll[reg1,reg2];
reg1[h_, r_] := Cylinder[
{
{0,0,h/2},
{0,0,-h/2}
}
, r
];
reg2[a_] := InfinitePlane[
{0,0,0},
{
{0,1,0},
{Cos[a], 0, Sin[a]}
}
];
Animate[
With[
{
h=2,
r=1
},
Graphics3D[ {reg1[h,r], reg2[a]} ]
]//Evaluate
,{a, 0, Pi/4}
]
I would like to have an analytical symbolic expression for the intersection of these two regions and their area.
If I calculate it with specific values, I do get a reasonable output.
Assuming[
And[
0 < a < Pi/8,
Element[h, PositiveReals]
Element[r, PositiveReals]
],
With[
{
a=Pi/16,
h=100,
r=1
},
Area[
RegionIntersection[
reg1[h, r],
reg2[a]
]
]
]
]
But I get undefined otherwise:
Assuming[
And[
0 < a < Pi/8,
Element[h, PositiveReals]
Element[r, PositiveReals]
],
With[
{},
Area[
RegionIntersection[
reg1[h, r],
reg2[a]
]
]
]
]
(* Undefined*)
I'm using Wolfram Engine 14.0. Can't test on Wolfram Cloud because the computation exceeds the time limit for free accounts.
$Version
(* 14.0.0 for Microsoft Windows (64-bit) (December 21, 2023) *)
Am I missing a way to obtain symbolic expressions both for the region definition and its calculated quantities?
Is there a method to go from a Region
to a symbolic condition, something like the inverse of ImplicitRegion
, which goes from a condition to a Region
?