For a demonstration project, I am calculating certain geometric properties of a region (an isosceles triangle in this example), as follows:
baseshape = SASTriangle[2, Pi/6, 2];
cbs0 = RegionCentroid[baseshape];
baseshape = TransformedRegion[baseshape, TranslationTransform[-cbs0]];
This calculates the centroid, and moves the region so its centroid is at the origin. Now I am going to rotate the region, move it down by depth
, and define the part of the region that lies below y=0
as a new region, as follows:
rrs[\[Theta]_?NumericQ, depth_?NumericQ] :=
RegionIntersection[
TransformedRegion[
TransformedRegion[baseshape, RotationTransform[\[Theta]]],
TranslationTransform[{0, -depth}]],
ImplicitRegion[y <= 0, {x, y}]];
However, I get an error message when I try to plot this:
Plot[Area[rrs[0, depth]], {depth, -0.7, 1.4}]
Area::reg: rrs(0,d,{0,0}) is not a correctly specified region.
The plot looks fine, but I don't understand the reason for the error message. What am I missing?
Area[rrs[0,depth]]
gives a pure function with several variables, may be the reason behind the error message. $\endgroup$ – Vahagn Tumanyan Sep 8 '16 at 6:11area[depth_?NumericQ] := Area[rrs[0, depth]]
and plotarea[depth]
. $\endgroup$ – Chip Hurst Sep 8 '16 at 19:43