Message Boards Message Boards

0
|
1981 Views
|
1 Reply
|
0 Total Likes
View groups...
Share
Share this post:

How to use "RegionDifference"?

Posted 8 years ago

Hi to all,

this is my code:

g1 = RegionPlot3D[
  36 Exp[2 x] - y^2 >= z^2, {x, 0, 5}, {y, -40, 40}, {z, -30, 30}]
g2= RegionPlot3D[(5 - x)^2 - y^2 >= z^2, {x, 0, 5}, {y, -40, 
   40}, {z, -30, 30}]
reg = RegionDifference[aa1, aa2];
RegionPlot3D[reg, PlotPoints -> 100, Axes -> True, 
 PlotStyle -> Opacity[0.5]]

but it doesn't plot. Why? What it is my error? Alternativies?

Thanks to all

Stefan

POSTED BY: Stefan AS
Posted 8 years ago

Solved!

This is the improved and corrected code:

regionA = ImplicitRegion[36 Exp[2 x] - y^2 >= z^2, {x, y, z}]
GA = RegionPlot3D[regionA, BoxRatios -> Automatic, 
  PlotRange -> {-5, 5}, AxesOrigin -> {0, 0, 0}, Axes -> True, 
  Boxed -> False]
regionB = ImplicitRegion[(5 - x)^2 - y^2 >= z^2, {x, y, z}]
GB = RegionPlot3D[regionB, BoxRatios -> Automatic, 
  PlotRange -> {-5, 5}, AxesOrigin -> {0, 0, 0}, Axes -> True, 
  Boxed -> False]
reg = RegionPlot3D[RegionDifference[regionA, regionB], 
  BoxRatios -> Automatic, PlotRange -> {-5, 5}, 
  AxesOrigin -> {0, 0, 0}, Axes -> True, Boxed -> False]

Regards

Stefan

POSTED BY: Stefan AS
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