3
$\begingroup$

I have a task to make an intersection between the convex set and the box , the equation describing the convex set is r1r2r3 - r1 -r2 - r3 + 2 cos(phi) > 0, phi = 45 ,and I plot it using p2 = ContourPlot3D[xyz - x - y - z + 2*Cos[45] == 0, {x, 0, 4}, {y, 0, 4}, {z, 0, 4}]. but , I have no idea how to plot the box and how to make the intersection between them to obtain the figure (b). note that to plot the box r1=3.7, r2=1.3 , r3=3. can anyone help me?enter image description here

$\endgroup$

1 Answer 1

3
$\begingroup$

Here wee use {x, 0.5, r1}, {y, 0.5, r2}, {z, 0.5, r3} to cut the region x*y*z - x - y - z + 2*Cos[45] > 0 and set the PlotRange to some large space PlotRange->{{0, r1 + 1}, {0, r2 + 1}, {0, r3 + 1}} and then we get the second plot intersection.

r1 = 3.7; r2 = 1.3; r3 = 3;
intersection = 
 RegionPlot3D[
  x*y*z - x - y - z + 2*Cos[45] > 0, {x, 0.5, r1}, {y, 0.5, r2}, {z, 
   0.5, r3}, PlotRange -> {{0, r1 + 1}, {0, r2 + 1}, {0, r3 + 1}}]

regs = RegionPlot3D[{0 <= x <= r1 && 0 <= y <= r2 && 0 <= z <= r3, 
    x*y*z - x - y - z + 2*Cos[45] > 0}, {x, 0.5, r1 + 1}, {y, 0.5, 
    r2 + 1}, {z, 0.5, r3 + 1}, 
   PlotStyle -> {Directive[Gray, Opacity[.2]], 
     Directive[Pink, Opacity[.2]]}, Mesh -> None];
Show[regs, intersection]

enter image description here

$\endgroup$
1
  • $\begingroup$ thank you so much $\endgroup$
    – Ranim Ali
    Jul 21, 2021 at 13:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.