Group Abstract Group Abstract

Message Boards Message Boards

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

Cropping ContourPlot 3D into an ellipsoid?

Posted 3 years ago

Hello Wolfram Scientists!

Do any of you know how I can crop/clip my Contour Plot 3D to fit inside an Ellipsoid? Basically, I want the result of my function to be bounded by an ellipsoid.

Thank you!

Example ina Sphere:

ContourPlot3D[x^3 + y^2 - z^2 == 0, {x, y, z} \[Element] Ball[]]

Example in PolyhedronData: https://mathematica.stackexchange.com/questions/48468/cropping-a-non-cubic-lattice-unit-cell

Ellipsoid:

a = 3; b = 2; c = 1;
ContourPlot3D[x^2/a^2 + y^2/b^2 + z^2/c^2 == 1, {x, -3, 3}, {y, -3, 3}, {z, -3, 3}]
POSTED BY: Ricardo Canedo

One way is to use RegionFunction:

With[{a = 3, b = 2, c = 1},
 ContourPlot3D[x^3 + y^2 - z^2 == 0,
  {x, -3, 3}, {y, -3, 3}, {z, -3, 3},
  RegionFunction -> Function[{x, y, z},
    x^2/a^2 + y^2/b^2 + z^2/c^2 <= 1]]]
POSTED BY: Gianluca Gorni
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard