# "Undefined" when attempting analytical expression for a RegionIntersection and its Area in V14.0

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*)


\$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?

Assuming[ And[0 < a < Pi/8,  Element[h, PositiveReals] Element[r, PositiveReals]],
With[{}, Area[RegionIntersection[reg1[h, r], reg2[a]]]]]


works in 14.1 on Windows 10, resulting in

Piecewise[{{Pi*r^2*Sqrt[1 + Tan[a]^2], (h < 0 && Inequality[h/(2*r), Less, Tan[a], Less, -1/2*h/r]) || (h > 0 && Inequality[-1/2*h/r, Less, Tan[a], Less, h/(2*r)])}}, (r*Abs[h]*Cot[a]*(h*Sqrt[4 - (h^2*Cot[a]^2)/r^2] + 4*r*ArcCsc[(2*r*Tan[a])/h]*Tan[a])*Sqrt[1 + Tan[a]^2])/(2*h)]

Also, based on @azerbajdzan also in 13.0.1. This may be a bug in 14.0.

reg = Assuming[
And[
0 < a < Pi/8,
Element[h, PositiveReals],
Element[r, PositiveReals]
],
RegionIntersection[reg1[h, r], reg2[a]]
];
RegionConvert[reg, "Implicit"]


produces

ImplicitRegion[  r >= 0 && h != 0 &&    0 <= 1/2 - \[FormalZ]/h <= 1 && \[FormalX]^2 + \[FormalY]^2 <=     r^2 && \[FormalZ] == \[FormalX] Tan[      a], {\[FormalX], \[FormalY], \[FormalZ]}]


Unfortunately,

reg1 = RegionConvert[reg,     "Implicit"] /. {\[FormalX] -> x, \[FormalY] -> y, \[FormalZ] -> z,     h -> 1, r -> 1, a -> 3/10};RegionMember[reg1, {x, y, z}]


fails. The input

(x|y|z)\[Element]\DoubleStruckCapitalR]&&0<=1/2-z<=1&&x^2+y^2<=1&&z==x Tan[3/10]


is returned.

• Thanks, can you get a symbolic expression for the region definition? Commented Aug 14 at 12:28
• @rhemans: The code reg = Assuming[ And[0 < a < Pi/8, Element[h, PositiveReals] Element[r, PositiveReals]], RegionIntersection[reg1[h, r], reg2[a]]];RegionConvert[reg, "Implicit"] produces ImplicitRegion[ r >= 0 && h != 0 && 0 <= 1/2 - \[FormalZ]/h <= 1 && \[FormalX]^2 + \[FormalY]^2 <= r^2 && \[FormalZ] == \[FormalX] Tan[ a], {\[FormalX], \[FormalY], \[FormalZ]}]. Commented Aug 14 at 12:37
• Ok, I think I need to move to 14.1 . Thanks Commented Aug 14 at 12:38
• Unfortunately, re1 = RegionConvert[reg, "Implicit"] /. {\[FormalX] -> x, \[FormalY] -> y, \[FormalZ] -> z, h -> 1, r -> 1, a -> 3/10};RegionMember[reg1, {x, y, z}] fails (The input is returned.). Commented Aug 14 at 12:47
• Good, I was missing RegionConvert and RegionMember, even if they fail in this example case. If you put that in your answer I will accept it, provided there is nothing more complete by then. Commented Aug 14 at 12:59

This outputs the result after quite some time.

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]}}];

Assuming[{a, h, r} \[Element] Reals,
RegionIntersection[reg1[h, r], reg2[a]] // Area]


• What version are you using? I have 14.0.0 for Microsoft Windows (64-bit) (December 21, 2023) (Wolfram Engine) and I get Undefined with your code, as well as with mine. Commented Aug 14 at 12:19
• Version 13.0.1 and it took about 3 minutes. Commented Aug 14 at 12:50
• Interesting, perhaps this is a 14.0 bug then. Commented Aug 14 at 12:55